Solving problems with RDP to an Azure VM

Solving problems with RDP to an Azure VM

Q. I cannot RDP to my VM in Azure, what can I do?

A. There are a number of things to try.

  1. Make sure its running! Also try shutting it down from the portal and restarting it
  2. If you are connecting from the Internet make sure you have the correct service name and endpoint (for ASM) for the VM or if its an ARM VM ensure you have a PIP for the VM or a load balancer with a NAT rule pointing to 3389 for the VM
  3. If connecting via ExpressRoute or S2S VPN ensure the connection is functioning and available
  4. If you have the Azure agent installed in the VM run the PowerShell below to reset RDP and make sure its enabled and the firewall rule open:
    $AzureVM = Get-AzureVM -ServiceName <service name> -Name <vm name>
    $AzureVM | Set-AzureVMAccessExtension | Update-AzureVM #Enable RDP
  5. If you still cannot RDP check if there is a Network Security Group applied to the subnet the VM is in and if so remove the NSG if you think it is blocking the RDP access (or create a new one overriding to enable RDP)
    Get-AzureNetworkSecurityGroupForSubnet -VirtualNetworkName <virtual network name> -SubnetName <subnet name>
    Get-AzureNetworkSecurityGroup -Name "<name of NSG found" | Remove-AzureNetworkSecurityGroupFromSubnet -VirtualNetworkName <virtual network name> -SubnetName <subnet name>
  6. If all else fails you could try deleting the VM while keeping its storage and then recreating
  7. Finally download the VHD and try fix on a local Hyper-V box
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.