Create a public accessable Azure Windows Server VM. In this example I am using Windows Server 2016.

Make sure that the VM:
- has a public IP Address.
- has a valid DNS name ( e.g. xxx.eastus.cloudapp.azure.com)
Configure the Network Security Group to accept HTTPS request from port 443
Make sure your Windows Server firewall does not block inbound request from 443. The default Azure Windows Server 2016 should have this port opened.
Configure the Windwos Server WinRM (PowerShell remote service)
Open a PowerShell console and execute the following commands:
- Enable WinRM remote
enable-psremoting -force
- Set Trusted Hosts. If you do not know your local PC public IP range, you may have to use "*" to allow all ips.
Allow a IP range:
set-item wsman:\localhost\Client\TrustedHosts -value <Your
Local Computer Public IP Address range>
Allow all IPs:
set-item wsman:\localhost\Client\TrustedHosts -value *
- Enable HTTPS via 443 port. (As default the WinRM uses 5986 port for HTTPS requests)
Set-Item
WSMan:\localhost\Service\EnableCompatibilityHttpsListener -Value true
- Restart WinRM
restart-service WinRM
- Create a new self signed certifcate based on your virtual machine DNS name
- Configure WinRM to use self signed certificate for HTTPS connection
-
This complete the Server side configuration.
enable-psremoting -force
Allow a IP range:
set-item wsman:\localhost\Client\TrustedHosts -value <Your Local Computer Public IP Address range>
Allow all IPs:
set-item wsman:\localhost\Client\TrustedHosts -value *