Change Azure virtual machine name in Azure portal

Manjunath Rao picture Manjunath Rao · Apr 10, 2018 · Viewed 30.4k times · Source

Can we change the name of an Azure Virtual Machine in the Azure portal? I am sure we cannot change it via portal, do we have any PowerShell cmdlet to change the virtual machine name??

Note: I am not referring to VM name inside the VM, but the name that is displayed in the Azure Portal.

Answer

Zair Henrique picture Zair Henrique · Apr 10, 2018

Resource names for virtual machines are immutable. So, you will need to redeploy your virtual machine.

Best way to do this is to delete the current one, maintaining the disks, and then create a new one with the correct name pointing to those disks.