Hello All ,
On today sharing i wanted to introduce a new Azure Cli extension that can quickly been deploy a rescue vm and attach a copy of a OS disk VM with facing boot issue by a single command line.
So by one command we are deploying a new VM and attaching a copy of our Bad Os disk
And then by another command restoring it.
First we need to register the extension : az extension add -n vm-repair
Then it can be used.
https://docs.microsoft.com/en-us/cli/azure/ext/vm-repair/vm/repair

So this create a new Temp VM and attach your OS disk as a data disk. Then you should to fix your Os issue .
once you are done
Run the below Restore command.
It will swap between the the fixed Os disk [Copy] with the original VM Os disk [corrupted] . deleted the temp resource group and VM components
Please confirm the Temp resource group and the VM and its dependencies are deleted if not please delete to avoid over costs.
For Example :
az group delete -g repair-scenarios-demo1-20200414184741.221389

Remember if you face any issue Feel free to raise a ticket to our wonderfully Azure support and an engineer will be happy to assist mitigate the issue.
Thank you , Tzachi Elkabatz