How to connect to a Virtual Machine on Azure?

Once you have created an Azure VM instance with the default settings, you will be able to connect to it.

The connectivity method will depend on the operating system running within the VM:

  • RDP allows you to establish a GUI session to an Azure VM that runs the Windows operating system. When viewing a Windows VM in the Azure Portal, you will have access to the Connect This action automatically provisions an .rdp file, which you can either open or download, and save for later use. Opening the file initiates an RDP connection to the corresponding VM. The Azure PowerShell Get-AzureRemoteDesktopFile cmdlet delivers the same outcome when you invoke it from the Windows PowerShell console.
  • SSH allows you to establish a command-line interface session to an Azure VM that runs the Linux operating system. To establish such a session, you typically use a terminal emulator, such as PuTTY (available for both Windows and Linux operating systems).

For security reasons, you can disable connectivity to Azure VMs from the Internet by removing the public IP address associated with the virtual machine. In this case, you would connect to it from a jump VM on the same Azure virtual network. You also would connect from your on-premises computers, if you establish a secure connection to the target virtual network.

To sign in to a VM, you use credentials that you specified during its creation. When connecting via SSH, it is also possible to use certificate-based authentication, if you selected the SSH public key authentication type when creating the Linux VM.

Note: If you forget the password for the Azure VM, you can perform a password reset by using the VMAccess and VMAccessforLinux extensions.

Each Windows VM created by using an Azure Marketplace image has its local Windows Firewall enabled. By default, Windows Firewall has the rule that allows incoming RDP connections enabled. However, if you want to allow connectivity on a different port (such as HTTP port 80), you will need to configure Windows Firewall accordingly.

The same principle applies to Azure network security groups associated with a newly created VM. By default, such a group will include a rule allowing connectivity via RDP or SSH (depending on the operating system of the VM). Enabling incoming connections on other ports would require the addition of extra rules to the security group.

Written by Marcos Nogueira

Marcos Nogueira

With more than 18 years experience in Datacenter Architectures, Marcos Nogueira is currently working as a Principal Cloud Solution Architect. He is an expert in Private and Hybrid Cloud, with a focus on Microsoft Azure, Virtualization and System Center. He has worked in several industries, including Aerospace, Transportation, Energy, Manufacturing, Financial Services, Government, Health Care, Telecoms, IT Services, and Gas & Oil in different countries and continents.

Marcos was a Canadian MVP in System Center Cloud & Datacenter Managenment and he has +14 years as Microsoft Certified, with more than 100+ certifications (MCT, MCSE, and MCITP, among others). Marcos is also certified in VMware, CompTIA and ITIL v3. He assisted Microsoft in the development of workshops and special events on Private & Hybrid Cloud, Azure, System Center, Windows Server, Hyper-V and as a speaker at several Microsoft TechEd/Ignite and communities events around the world.

Leave a Reply

Your email address will not be published. Required fields are marked *