How to connect and sign on to an Azure virtual machine running Windows

You'll use the Connect button in the Azure portal to start a Remote Desktop (RDP) session from a Windows desktop. First you connect to the virtual machine, and then you sign on.

To connect to a Windows VM from a Mac, you will need to install an RDP client for Mac such as Microsoft Remote Desktop.

Connect to the virtual machine

  1. If you haven't already done so, sign in to the Azure portal.

  2. On the left menu, select Virtual Machines.

  3. Select the virtual machine from the list.

  4. On the top of the page for the virtual machine, select Connect.

  5. On the Connect to virtual machine page, select the appropriate IP address and port. In most cases, the default IP address and port should be used. Select Download RDP file. If the VM has a just-in-time policy set, you first need to select the Request access button to request access before you can download the RDP file. For more information about the just-in-time policy, see Manage virtual machine access using the just in time policy.

  6. Open the downloaded RDP file and select Connect when prompted.

  7. You will get a warning that the .rdp file is from an unknown publisher. This is expected. In the Remote Desktop Connection window, select Connect to continue.

    Screenshot of a warning about an unknown publisher.

  8. In the Windows Security window, select More choices and then Use a different account. Enter the credentials for an account on the virtual machine and then select OK.

    Local account: This is usually the local account user name and password that you specified when you created the virtual machine. In this case, the domain is the name of the virtual machine and it is entered as vmname\username.

    Domain joined VM: If the VM belongs to a domain, enter the user name in the format Domain\Username. The account also needs to either be in the Administrators group or have been granted remote access privileges to the VM.

    Domain controller: If the VM is a domain controller, enter the user name and password of a domain administrator account for that domain.

  9. Select Yes to verify the identity of the virtual machine and finish logging on.

    Screenshot showing a message abut verifying the identity of the VM.


    If the Connect button in the portal is grayed-out and you are not connected to Azure via an Express Route or Site-to-Site VPN connection, you will need to create and assign your VM a public IP address before you can use RDP. For more information, see Public IP addresses in Azure.

Connect to the virtual machine using PowerShell


This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. For Az module installation instructions, see Install Azure PowerShell.

If you are using PowerShell and have the Azure PowerShell module installed you may also connect using the Get-AzRemoteDesktopFile cmdlet, as shown below.

This example will immediately launch the RDP connection, taking you through similar prompts as above.

Get-AzRemoteDesktopFile -ResourceGroupName "RgName" -Name "VmName" -Launch

You may also save the RDP file for future use.

Get-AzRemoteDesktopFile -ResourceGroupName "RgName" -Name "VmName" -LocalPath "C:\Path\to\folder"

Next steps

If you have difficulty connecting, see Troubleshoot Remote Desktop connections.