In this Azure tutorial, we will discuss how to fix the error the virtual machine must be running before using vmaccess. That I got while I was trying to change Azure VM Password.
The virtual machine must be running before using vmaccess.
Below are the steps that I followed to change Azure VM Password in Azure Portal, and I got this error.
You can follow the below steps to reset the password for the virtual machine
1. Login to https://portal.azure.com/
2. Search for Virtual machines there.

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

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

5. Select the Reset Password option under support + troubleshooting from the left side menu.

6. As you will see in the screenshot below, the Reset password option is disabled. It does not allow me to change the password and says, “The virtual machine must be running before using VMAccess.”

This is because my VM’s status may be Stopped (deallocated) or not running. Let’s check that.
Below, the VM status is Stopped (deallocated). To fix the error “the virtual machine must be running before using vmaccess,” click the start button. After that, the VM status will be Running.

7. Now, if you click on the Reset Password option again, you will see that it is enabled.
Choose the Mode as Reset password.
Enter the username and password, confirm the password, and click the Update button.

This is how you can reset your VM password from the Azure portal.
Change Azure VM Password using PowerShell
Follow the below steps.
1. First, connect to the Azure account using the below command.
Connect-AzAccount 2. Select the Azure subscription ID
$MySubID = "<Mentio