Unfortunately there is no native way to rename an azure VM. However there are a few methods you can do to achieve renaming your VM. One method is you can easily rebuild the azure vm with its new name from its OS disk.
1. Navigate to your virtual machine in Azure and make note of the VM size, the network & subnet it is on, and any other specific VM info you may find important. Then stop the VM.
2. After the VM is deallocated, select “Delete”.
3. On the deletion blade, expand the OS disk and take note of the OS disk name. Then uncheck “Delete with VM,” and complete the VM deletion.
4. Navigate to Disks, find and choose the OS disk you noted earlier.
5. In the disk blade, click +Create VM.
6. In the VM creation blade, enter the new VM name, keep the image as the OS disk, and proceed to build the VM from disk.
And there you have it! You will have your same VM but under a new name!