For an Azure VM stuck in Failed state, the supported first step is to reapply the VM state.
- In the Azure portal, open the affected VM.
- Go to Support + troubleshooting > Redeploy + reapply.
- Select Reapply.
This updates the VM objects and properties. This resolution is supported only for API version 2019-07-01 or later.
CLI option:
az vm reapply -g MyResourceGroup -n MyVm
PowerShell option:
Get-AzVM -ResourceGroupName <ResourceGroup> -Name <VMName>
Set-AzVM -ResourceGroupName <ResourceGroup> -Name <VMName> -Reapply
Update-AzVM -VM <PSVirtualMachine> -ResourceGroupName <ResourceGroupName>
If VM operations continue to fail after reapply, check these in the Azure portal:
- Provisioning State
- Resource Health
- Activity Log to identify the operation that first caused the VM to enter the failed state
If the issue persists and start/stop/delete operations continue to fail, backend intervention may be required through Microsoft Support.
References: