Hi @hanidan , Welcome to MS Q&A
To rename an existing Azure virtual machine, you can modify the hostname of the VM. This can be done by renaming the computer from a remote desktop session or by using the Run command in the Azure portal.
For Windows, you can change the hostname from PowerShell by using the Rename-Computer
command. For Linux, you can change the hostname by using hostnamectl
. After you run either Rename-Computer
or hostnamectl
on your VM, you need to restart your VM for the hostname to change.
For more and step wise details, you can refer to the Azure documentation on Viewing and Modifying Hostnames.
Kindly accept answer , if it helps
Please let me know if further questions
Thanks
Deepanshu