title: Can't Connect to Azure VM Using RDP
body: <p>I'm setting up a new vanilla Windows Server 2016 VM on Azure cloud, and want to connect via RDP. I followed the steps in the <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/quick-create-portal" rel="nofollow noreferrer">Quickstart</a> guide, but when I try to connect from a Windows 8 client on the company LAN, I get "An internal error has occurred." When I try to connect from an Android client on the public internet, I get "We couldn't connect to the remote PC. This might be due to an expired password. If this keeps happening, contact your admin or tech support for help. Error code: 0x207".</p>
  
  <p>I've already tried the following.</p>
  
  <ul>
  <li>Restarted the server</li>
  <li>Deleted and recreated the VM from scratch</li>
  <li>Checked the boot diagnostics screenshot (VM is on Ctrl+Alt+Del screen without showing any errors)</li>
  <li>Checked the network interface rules (HTTP, HTTPS, and RDP allowed on 80, 443, and 3389 respectively over TCP from any source, allowed, prioritised)</li>
  <li>Reset the configuration (Support + Troubleshooting > Reset password > reset configuration only)</li>
  <li>Changed the private IP address to a new address within the subnet (10.0.0.4 > 10.0.0.5)</li>
  <li>Pinged the VM using SysInternals PSPing on the public IP address, port 3389 (0% loss, average 24ms)</li>
  <li>I can connect using Serial console, and have checked the following:
  
  <ul>
  <li>Installed IIS using PS <code>Install-WindowsFeature -name Web-Server -IncludeManagementTools</code> I can view the IIS start screen from my browser using the public IP address</li>
  <li>Check if the RDP is disabled by polices.
  
  <ul>
  <li><code>reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server " /v fDenyTSConnections</code> > returns 0</li>
  <li><code>reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fDenyTSConnections</code> > key does not exist</li>
  </ul></li>
  <li>Check the current configuration of the terminal server. <code>reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v TSEnabled</code> > key did not exist, therefore added it using <code>reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v TSEnabled /t REG_DWORD /d 1 /f</code> > key added successully</li>
  <li>Check whether set to drain mode <code>reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v TSServerDrainMode</code> > key does not exist</li>
  <li>Check whether you can connect to the terminal server. <code>reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v TSUserEnabled</code>> returns 0</li>
  <li>Check the current configuration of the RDP listener. <code>reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Winstations\RDP-Tcp" /v fEnableWinStation</code> > returns 0</li>
  <li>Check whether you can connect to the RDP listener. <code>reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Winstations\RDP-Tcp" /v fLogonDisabled</code> > returns 0</li>
  </ul></li>
  </ul>
  
  <p>So I've followed all the online help guides I can find, rebuilt the VM, and tried accessing the VM from two different clients on two different networks, and nothing works! Any ideas?</p>