Resetting the Local Admin Name and Password for Azure ARM Virtual Machines with PowerShell

Hi there, this is JJ Streicher-Bremer, saying hello from Azureland.

 

When one creates a virtual machine in the Azure portal a username and password are required. This username and password are used by the Azure fabric to configure the local administrator account on that virtual machine.

clip_image002[6]

 

I don’t know about you, but sometimes my memory fails me and I forget the username/password I set on my Azure virtual machines. If this is a “classic” virtual machine, the portal provides a nice UI that allows us to reset this username and password.

clip_image004[7]

 

However for ARM (Azure Resource Manager) Virtual Machines we are presented with this screen:

clip_image006[5]

 

What is even more frustrating is that the Azure documentation tells us how to reset the admin username and password for classic VMs, but not ARM (Azure Resource Manager) deployed VMs.

clip_image007[4]

https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-reset-password/

 

The good news is that we _can_ reset the username and password of Azure VMs deployed in ARM with the set-azurermvmextension command. https://msdn.microsoft.com/en-us/library/mt619447.aspx

Unfortunately the MSDN document page doesn’t give an example, so I wanted to provide one here:

If successful you should see something like this:

clip_image009[4]

Go ahead and log into your Azure ARM VM with the reset admin account and password you set.

 

Have fun and enjoy Azure!

 

JJ Streicher-Bremer