Renaming Azure VM is simple but not easy. Following this blog you can rename azure vm in 4 various option.
For various reason you want to rename newly created or existing azure vm name but changing the name for azure vm is not a simple rename task like in the file explorer. Because when you create a VM, Microsoft Azure create and assign various dependencies like Network card, IP address, virtual disk, etc.,
There is no rename option available for the Azure VM in the Azure portal at present and you cannot achieve this task either through any PowerShell or any other commands. Maybe Microsoft can think about this and provide a simplified option through the poral in future.
Vote For Rename Azure VM Feature
Now sure about you but, I need this feature desperately for many of my clients. There is an open request for Rename Azure VM in the Microsoft Azure Feedback form with 950+ vote. Unfortunately, there is no update current status update from Microsoft side. So, we have to wait till Microsoft provide this feature on their timeline.Vote Now
There are 4 ways to rename a VM in Azure
- Delete the VM by keeping the Disk and recreate the VM with the NEW name
- Use anyone of the following blog, to rename Azure VM using PowerShell script (It will automatically delete the VM and create a new VM with the NEW name)
- Easiest option I prefer is Backup the VM and restore the VM with the New Name
- Stop the VM and Create managed disks snapshots, Create new managed disks from snapshots in the Resource Group and Deploy new VM using using managed disks in the Resource Group
Options 1 and 2 are complicated So, I prefer the 3rd or 4th easiest option. For 3rd option, please follow this step-by-step Instruction
Backup VMs documentation:
Restore VM documentation:
At the time of restoring VM make sure you select “Create New” option as shown in the image below and give the new VM name.
I hope this helps.