An Azure service that is used to provision Windows and Linux virtual machines.
Accepted. There was Page Blob attached to the resource. I deleted it and am trying the delete again.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Attempting to delete the VM from the Azure Portal receives the follow error:
I have manually deleted the attached disk successfully. It doesn't show up anymore.
I have tried a dozen times to delete the network interface. Azure still shows the network interface. Each attempt to detach the interface - I am met with "No network interfaces available to detach". That network interface is not attached to any other resource.
Every attempt to redeploy the VM fails.
I check for resource locks. The response: "This resource has no locks."
I can attempt to update the VM - "Operation 'Update VM' is not allowed on VM '<my VM>' since the VM is marked for deletion. You can only retry the Delete operation (or wait for an ongoing one to complete)."
When I retry the deletion, without trying to delete any attached resources. The activity log shows that the Deletion has been started but ultimately fails with the first message of this issue - "The resource operation completed with terminal provisioning state 'Failed'."
CoPilot does not seem to help. All suggested CLI commands either fail or look like they are successful but, in the end, I end up with all of the same errors above.
Is there something obvious that I doing wrong?
An Azure service that is used to provision Windows and Linux virtual machines.
Accepted. There was Page Blob attached to the resource. I deleted it and am trying the delete again.
Hey there! It looks like your VM is stuck in a “Failed” delete state because Azure still thinks there’s a network interface (NIC) attached—even though you don’t see one in the portal. When a resource’s provisioningState is stuck, the portal UI sometimes hides it, but you can still force-delete via CLI/PowerShell or the REST API.
Here’s what you can try:
az network nic list \
--resource-group <your-RG> \
--query "[].{Name:name, Id:id, State:provisioningState}" \
-o table
Get-AzNetworkInterface -ResourceGroupName <your-RG> |
Select-Object Name, Id, ProvisioningState
az network nic delete --ids <NIC-Id> --no-wait
Get-AzNetworkInterface -ResourceGroupName <your-RG> -Name <nicName> |
Remove-AzNetworkInterface -Force
az vm delete \
--resource-group <your-RG> \
--name <yourVM> \
--yes \
--no-wait
az resource delete \
--ids /subscriptions/<subId>/resourceGroups/<your-RG>/providers/Microsoft.Compute/virtualMachines/<yourVM>
az group delete -n <your-RG> --yes --no-wait
If after all this the VM/NIC are still stuck, you’ll need to open an Azure Support ticket so the backend engineers can clear the stale resource state.
Hope that helps! Let me know how it goes.
References
AI answer
Use a dependency‑first cleanup approach and then retry the VM delete, focusing on the NIC and any remaining dependent resources.
$machineName = 'VM_TO_DELETE'
$resGroupName = 'RESOURCE_GROUP'
$machine = Get-AzVM -Name $machineName -ResourceGroupName $resGroupName
# Remove the virtual network interface
$machine | Remove-AzNetworkInterface -Force
# Finally, delete the VM
$machine | Remove-AzVM -Force
For environments using AzureRM modules instead of Az modules, the equivalent cmdlet is:
$machine = Get-AzureRmVM -Name $machineName -ResourceGroupName $resGroupName
$machine | Remove-AzureRmNetworkInterface -Force
$machine | Remove-AzureRmVM -Force
This pattern removes the NIC directly from the VM object, which can clear stale associations that block deletion in the portal.MicrosoftAzureCompute_VMName and MicrosoftAzureCompute_DiskType to identify the VM and whether it is an OSDisk or DataDisk.OSDisk, ensure the VM is deleted (Step 2 above). If it is DataDisk, detach it from the VM and then delete the disk.MicrosoftAzureCompute_VMName and MicrosoftAzureCompute_DiskType are missing, the blob is explicitly leased but not attached to a VM. Break the lease by selecting Break lease, then delete the blob.This sequence aligns with the documented approach for removing VMs that are stuck because of dependent resources, especially unmanaged disks and NICs.
References: