
If your Windows virtual machine (VM) in Azure encounters a boot or disk error, you may need to repair the disk offline. A common example would be a failed application update that prevents the VM from being able to boot successfully.
This article details how to use Azure VM repair commands to automatically attach a broken OS disk to another Windows VM for offline repair. Through this procedure, the failed OS disk will automatically be unlocked on the second VM, called a repair VM, if the disk is encrypted with Azure Disk Encryption.
When the failed disk is attached to the repair VM, you can fix any errors and then rebuild your original VM with the repaired disk.
You can now use Azure VM repair commands to change the OS disk for a VM, and you no longer need to delete and recreate the VM.
Follow these steps to troubleshoot the VM issue:
To run the commands, you need a role that can create the following types of resources in the subscription:
Learn how to repair virtual machine VMware!