An Azure service that is used to provision Windows and Linux virtual machines.
Hello @BA,
Thank You for using Q & A forum
Azure VMs can get stuck when a previous operation didn't complete cleanly.
Resolution Steps
- Force-Redeploy via Azure Portal (Easiest)
Navigate to your VM in the Azure Portal
Under Help → click Redeploy + Reapply
Click Redeploy — Azure moves the VM to a new host node and forces a clean state
This resolves the issue in most cases.
- Force Stop via Azure CLI
Skip OS-level shutdown and force the VM off at the fabric level
az vm stop --resource-group <your-rg> --name <your-vm> --skip-shutdown
Then deallocate to fully release the compute allocation
az vm deallocate --resource-group <your-rg> --name <your-vm>
Confirm the state changed to "deallocated"
az vm get-instance-view --resource-group <your-rg> --name <your-vm> \
--query "instanceView.statuses[*].displayStatus"
- Cancel the Stuck Operation via REST API
Find the stuck operation ID
az vm list-operations --resource-group <your-rg> --name <your-vm>
Cancel it (replace with actual subscription/rg/vm values)
az rest --method post \
--url "https://management.azure.com/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Compute/virtualMachines/<vm-name>/cancelVMAgentUpgrade?api-version=2023-03-01"
- Restart the Azure VM Agent (if you have console access)
If you can reach the VM via Serial Console (Portal → VM → Serial Console):
Linux:
bash
sudo systemctl restart waagent
Windows:
powershell
Restart-Service WindowsAzureGuestAgent
Restart-Service WindowsAzureTelemetryService
If none of the above work after 60+ minutes:
Open an Azure Support ticket — Microsoft can force-reset the VM at the fabric level without data loss
If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.