How to access Azure VM (Virtual Machine)

In this azure tutorial, we will discuss How to access Azure VM (virtual machine). Apart from this, we will also discuss on the below topics:

  • Can’t connect azure virtual machine
  • How to connect the virtual machine using PowerShell
  • Azure virtual machine remote desktop can’t connect
  • Azure virtual machine RDP
  • Azure virtual machine windows 10

How to access Azure VM (Virtual Machine)

Let’s discuss how to access the Azure virtual machine (VM) which I have already created an Azure VM from the Azure portal.

Follow the below steps to access the VM

Step- 1: Login to https://portal.azure.com/

Step- 2: Search for Virtual machines there.

How to access the virtual machine in azure

Step- 3: You will see the list of VM created in your Azure subscription. It will show the VM name, Type, Status, ResourceGroup, Location, etc.

How to connect the virtual machine in Azure

Step- 4: Now click on the VM name. “MyNewVM” in my case. You can able to see the details of your virtual machine like Public IP address, status, Computer name, Operating system, Size etc.

how to access azure vm

Step- 5: The next step is click on “Connect” button and then select “RDP” from the options.

How to connect the Azure virtual machine

Step- 6: Now you can able to see the IP address and port number of your VM. By default, it will populate with the correct IP and Port number of your VM but you can cross-check and choose the appropriate one in case it is wrong and then click on the “Download RDP File” button.

Connect to the Azure VM

Step- 7: You can see how the RDP file will get downloaded. The name will be “YourVMname.rdp”.”MyNewVM.RDP” got downloaded in my case.

Access to azure VM

Step- 8: Now open the downloaded RDP file. Select the Connect button from the Remote Desktop Connection window.

Error connecting to my Azure VM

Step- 9: Now enter your credentials to connect to the Azure VM.

How to connect to my Azure VM

Step- 10: Select Yes option from the below window. Now you should able to connect to your VM.

Error connecting to my Azure virtual machine

Can’t connect azure virtual machine

Some times at Step- 8, after clicking on the connect button from the Remote Desktop Connection window you might get the below error

“Remote Desktop cannot connect to the remote computer for one of the reasons “

Remote Desktop cannot connect to the remote computer for one of the reasons

To fix this we need to perform few steps.

Now go to the Overview tab and see the status of your virtual machine. You can see the status is “Stopped“. This is the reason we are getting this error while trying to connect to the VM.

connection error while connecting to Azure VM

Now to fix this, we need to start the VM. To do so click on the Start button

connection error while connecting to Azure VM 1

Now if you will see the status of the VM is changed to “Running”.

how to access azure vm

Now if you will try to connect to the virtual machine, you should be able to connect with out any issue.

How to connect Azure VM (virtual machine) using PowerShell

To connect to the virtual machine using power shell, You should make sure the Azure PowerShell module is installed for you.

You can execute the below command in your power shell, Which will lunch the RDP window directly.

Get-AzRemoteDesktopFile -ResourceGroupName "newresgroup" -Name "MyNewVM" -Launch

Here, ResourceGroupName is the Resource group name specified by you while creating the virtual machine.

Name is nothing but the virtual machine name specified by you while creating the VM.

If you want to keep the downloaded RDP file in your local path and then you want to run the RDP file to connect the VM, You can run the below command in your Power shell window.

Get-AzRemoteDesktopFile -ResourceGroupName "newresgroup" -Name "MyNewVM" -LocalPath "C:\Raj\Azure"

Here, ResourceGroupName is the Resource group name specified by you while creating the virtual machine.

Name is nothing but the virtual machine name specified by you while creating the VM.

LocalPath is the path where you want to keep the downloaded RDP file locally.

Azure virtual machine remote desktop can’t connect

There are multiple issues you might get while connecting to your virtual machine. So that it fails to connect.

You can try out multiple ways to trouble shoot the actual issue.

Reset your Remote Desktop Connection

If you can’t connect to your virtual machine, There is a chance if you are resetting your connection might help you to fix the issue.

This step will reset the RDP configuration.

Step- 1: To do this, select your Virtual machine from the Azure portal and from the left menu from Support + troubleshooting section, select the “Reset password” button

Azure virtual machine remote desktop can't connect

Step- 2: Now the below window will open, select the mode as “Reset configuration only” and then click on the “Update” button.

How to connect the virtual machine using PowerShell

Check resource health of your Azure VM

You can check the health of your VM. To do so follow the below path

Step- 1: Select your Virtual machine from the Azure portal and from the left menu from Support + troubleshooting section, select the “Resource health” button

Check resource health of your Azure VM

Step-2: After clicking on the “Resource health” button you should see the status as “Available”. This is the symbol of a healthy VM.

How to check resource health of your Azure VM

Sometimes you might see the Resource health status as unavailable like below.

Resource health Unavailable for my VM

This is because, your VM status might be “Stopped(Deallocated)” or not running. Go to the Overview tab and check. If you can see here the status is “Stopped(deallocated)“. Now to fix this click on the Start button.

How to check the status of my Azure VM

Now after clicking on the Start button, You can see the status got changed to “Running”.

How can i start my azure VM

Now after clicking on the “Resource health” button you should see the status as “Available”.

Azure virtual machine remote desktop can't connect

Reset password of your Azure VM

You can reset your Azure VM password in case you forget it or showing wrong credentials .

To reset your password of your VM in Azure, follow the below steps.

Step-1: Select your Virtual machine from the Azure portal and from the left menu from Support + troubleshooting section, select the “Reset password” button

How to reset password of your Azure VM

Step-2: Select the Mode as “Reset password“. Enter your Username, Password, and Confirm password and then click on the Update button.

How to reset password of your Azure VM

Redeploy Azure VM

In case you are facing any network issue while connecting your virtual machine, you can redeploy your VM in Azure.

To do this, follow the below steps

Step-1: Select your Virtual machine from the Azure portal and from the left menu from Support + troubleshooting section, select the “Redeploy” button

How to redeploy your Azure VM

Step- 2:You will see the successful message once you click on Redeploy button.

How to redeploy your Azure VM

Restart Azure VM

To fix any small small issues inside your VM, you can simply restart your virtual machine.

You can restart your virtual machine by following the below steps

Step- 1: Select the Overview tab and click on Restart button.

How to restart the Azure VM

Step-2: Now select “Yes”.

Restart the Azure VM

Step- 3:You will get a successful message like below.

How can I restart my Azure VM

Azure virtual machine RDP

We can connect to the azure windows virtual machine by using Remote Desktop Protocol(RDP) from the Azure Portal as well as from your local PC.

Connecting to Azure VM using RDP from Azure Portal

You can follow the below steps to connect your VM through RDP from Azure portal.

Step- 1: Select your virtual machine in azure portal, Go to the Overview tab and click on “Connect” button. Then click on RDP option from there.

Azure virtual machine RDP

Step- 2: Now you can able to see the IP address and port number of your VM. By default, it will populate with the correct IP and Port number of your VM but you can cross-check and choose the appropriate one in case it is wrong and then click on the “Download RDP File” button.

How to download the RDP file

Step-3: Now your RDP file will get downloaded. You can open that and click on Connect button.

connect your VM using RDP option

Step- 4: Once you click on Connect button, now enter your credentials to connect to the Azure VM.

How can i connect to my Azure virtual machine.

Step- 5: Select Yes option from the below window. Now you should able to connect to your VM.

how do i connect to my Azure VM

Connecting to Azure VM using RDP from local PC

You can follow the below steps to connect your VM through RDP from your local system.

Step-1: Search for “mstsc” in your local machine you will find “Remote Desktop Connection” app. click on that.

How to connect your vm using RDP option

Step- 2: Now in the below window, enter the public IP of your virtual machine and then click on the “Connect” button.

How to connect to your Azure virtual machine

Step- 3: Enter your credentials to login to the virtual machine in the windows security window. Click on OK.

Connect to the Azure virtual machine using RDP

Step-4: Select Yes option from the below window. Now you should able to connect to your virtual machine (VM).

how do i connect to my Azure VM

Azure virtual machine Windows 10

You can access the azure virtual machine from widows 10.

First you need to login to the Azure portal. From the Azure portal you connect to the virtual machine and check if the Remote desktop connection is enabled in the virtual machine.

Search for settings then click on System. Click on the “Remote Desktop” option. If you can see Enable Remote Desktop option is off now for me. So need to make it On first.

Enable remote desktop option in azure virtual machine

Now change the Enable Remote Desktop option to on and click on “Confirm” button.

how to enable remote desktop option in azure virtual machine

If you can see the Enable Remote Desktop option is ON for you then no need to enable it again you can ignore the above two steps. By default the Enable Remote Desktop option is ON for newly created virtual machine in Azure.

Now to connect the virtual machine from Windows 10 machine locally via RDP you can follow the below steps.

Step- 1: First if you don’t know the public IP of your virtual machine login to the Azure portal and search for your virtual machine and click on that and go to the Overview tab.

Here you can see the public ip address of my virtual machine is “13.64.175.88”.

How to get the public ip address of your virtual machine in Azure

Step-2: Now search for “mstsc” in your local machine you will find “Remote Desktop Connection” app. click on that.

How to get the public ip address of your virtual machine in Azure

Step-3: Now in the below window, enter the public IP of your virtual machine and then click on the “Connect” button.

How to connect to the Azure VM from windows 10 machine

Step- 4: Enter your credentials to login to the virtual machine.

How to connect to the Azure virtual machine from windows 10 machine

Step- 5: Select Yes option from the below window. Now you should able to connect to your VM in Azure.

how do i connect to my Azure VM

This is how we can connect the windows Azure virtual machine from windows 10 machine locally.

You may like following Azure tutorials:

Conclusion

In this Azure tutorial, We discussed

  • How to access Azure VM (Virtual Machine)
  • Can’t connect azure virtual machine
  • How to connect Azure VM (virtual machine) using PowerShell
  • Azure virtual machine remote desktop can’t connect
  • Reset your Remote Desktop Connection
  • Check resource health of your Azure VM
  • Reset password of your Azure VM
  • Redeploy Azure VM
  • Restart Azure VM
  • Azure virtual machine RDP
  • Connecting to Azure VM using RDP from Azure Portal
  • Connecting to Azure VM using RDP from local PC
  • Azure virtual machine Windows 10

Leave a Comment