Azure VM stuck on 'Getting ready' fix
Azure VM provisioning hangs at 'Getting ready' because an extension script times out. We'll walk you through the fix, from a quick reboot to deleting the stuck extension.
Quick fix (30 seconds): Reboot the VM
Azure VMs sometimes just need a kick. The extension script was running and got stuck -- a reboot cancels it and starts fresh.
- Go to your VM in the Azure portal.
- Click Overview.
- Click Restart.
Give it 2-3 minutes. If the status changes from 'Getting ready' to 'Running', you're set. If it's still stuck after 5 minutes, move to the next step.
Real-world trigger: This happens often after you deploy a custom script extension or a Microsoft Security extension (like Antimalware for SQL) that takes too long to run. The VM thinks the provisioning isn't done.
Don't bother with a stop/deallocate yet — that's slower and won't help if the extension is the problem.
Moderate fix (5 minutes): Reset the VM state
If the reboot didn't work, the extension is probably stuck in a retry loop. Reset the VM state to clear the provisioning status.
- In the Azure portal, go to your VM.
- Click Help (left sidebar) > Reset password.
- You don't need to actually reset the password. Just click Update with the current admin username and password. This triggers a VM agent reset.
Alternatively, use Azure CLI (faster in my experience):
az vm reapply --resource-group MyResourceGroup --name MyVMName
This command forces the VM agent to re-evaluate all extensions. Wait 3-5 minutes. The VM should transition to 'Running' soon after.
Why this works: The VM agent got stuck processing an extension script that timed out. Resetting the state cancels that process and makes the agent start over.
I've seen this fix work 80% of the time. If it doesn't, you need to get your hands dirty.
Advanced fix (15+ minutes): Delete the stuck extension
When the first two steps fail, the extension itself is corrupted or has a configuration error. You need to remove it and re-add it.
Step 1: Find the problem extension
In the portal, go to your VM > Extensions + applications. Look for any extension showing Transitioning or Unknown status. That's your culprit.
If you can't see it (the page might be slow), use Azure CLI:
az vm extension list --resource-group MyResourceGroup --vm-name MyVMName --query "[?provisioningState!='Succeeded'].{Name:name, State:provisioningState}" -o table
This lists all extensions that aren't in a 'Succeeded' state. Note the name.
Step 2: Delete the extension
az vm extension delete --resource-group MyResourceGroup --vm-name MyVMName --name <extension-name>
Replace <extension-name> with the name you found. For example, if it's 'CustomScriptExtension', run:
az vm extension delete --resource-group MyResourceGroup --vm-name MyVMName --name CustomScriptExtension
Step 3: Check the VM status
After deletion, the VM agent finishes provisioning. The status should change to 'Running' within 2 minutes. If it doesn't, do another reboot.
Then reinstall the extension if you still need it. Use the portal or CLI:
az vm extension set --resource-group MyResourceGroup --vm-name MyVMName --name CustomScriptExtension --publisher Microsoft.Compute --settings '{"commandToExecute": "your-command-here"}'
Real-world scenario: I once had a VM stuck for 2 hours because the Custom Script Extension was trying to run a PowerShell script that referenced a file in a deleted storage account. Deleting the extension fixed it instantly.
Step 4: (If still stuck) Redeploy the VM
This is the nuclear option. It moves the VM to a different host node. Your data stays intact.
az vm redeploy --resource-group MyResourceGroup --name MyVMName
Or in the portal: VM > Help > Redeploy. This takes 5-10 minutes but clears almost all provisioning issues.
Skip this unless you've tried everything else. It's heavy but works when the VM agent itself is broken.
Why this happens
Azure VM provisioning runs extensions in a specific order. If an extension script takes longer than 5 minutes to finish, the agent marks it as 'Transitioning' and stops processing the rest. The VM stays 'Getting ready' until that extension completes or is removed.
Common extensions that cause this:
- Custom Script Extension (user scripts)
- DSC (Desired State Configuration)
- Microsoft Antimalware
- SQL Server IaaS Agent
The fix order matters: reboot first, because it's fast and free. Reset state if that fails. Delete the extension as a last resort before redeploying.
Don't waste time checking network connectivity, DNS, or firewall rules — the VM is already provisioned and talking to Azure. The problem is always the extension script or the agent itself.
Was this solution helpful?