Share via


Error - failed to delete the virtual machine

Question

Thursday, May 17, 2018 11:33 AM

I have a resource group where I cannot delete any of the resources in it using the console.     Applies to VM, disk, nic, storage.

When I try to delete I get a message box:

!Failed to delete the virtual machine

Failed to delete the virtual machine 'xxx'. Error:

error

I have got full rights so I don't think is that.  As stated , I get the same with any resource in the resource group.

If I use powershell I can delete the resources.**

All replies (6)

Thursday, May 17, 2018 1:09 PM

Suggest you, check and try to delete the resources from Azure portal on different browser and let us know.

Could you help us with the error message screenshot.

A few points to note here:

1- Resources such as VPN gateways, VM NICs etc could prevent the RG from deleting.

2- If you have any storage accounts which contained vhds for your VMs then it is first good to remove the lease on the blobs and then delete the storage accounts. Check the suggestions mentioned in the below article:

https://github.com/uglide/azure-content/blob/master/articles/storage/storage-cannot-delete-storage-account-container-vhd.md

/en-us/azure/storage/blobs/storage-troubleshoot-vhds#troubleshoot-storage-deletion-errors-for-a-vm

You will also have to delete the disks associated with your instances.

3- Resources such as Azure Key Vault will naturally have locks on them to prevent them from being deleted accidentally.

4- Check if there are any resource locks in your RG and remove them.

Note: Deleting the resource group will delete all the resources in that resource group kindly exercise caution. So, if you want to only delete specific resources, you will have to delete the resources individually.

You may also check the thread link which discusses about the similar issue.


Thursday, May 17, 2018 1:33 PM

Check if resource group is not locked. Lock level - CanNotDelete means authorized users can still read and modify a resource, but they can't delete the resource.

/en-us/azure/azure-resource-manager/resource-group-lock-resources

Goto Settings blade for the resource, resource group, or subscription that you wish to lock, select Locks
To delete the lock, select the ellipsis and Delete from the available options

Thanks, AT


Friday, May 18, 2018 10:13 AM

Thanks for your replies. 

I will try another browser to start with and let you know

I will go through that but just to add to my first post I am getting message

"Refresh the browser to try again" (time)

Microsoft_Azure_Compute extension failed to load

Then under the virtual machines link I cannot see the details of the vm's on the portal, I just get the dotted lines flashing across the screen.  I am using Edge with Win10.


Monday, May 21, 2018 10:12 AM

Did you get chance to check on different browser?

As you have mentioned “I cannot see the details of the vm's on the portal, I just get the dotted lines flashing across the screen”, could you help us with the screenshot


Thursday, May 24, 2018 12:01 PM

I can't supply a screenshot at the moment of that particular issue as it is erratic and I can't re-create it.

Sometimes we are allowed to delete the resources and sometimes we are not , using either browser.

Having said that, in general we find Edge to be the less responsive browser compared to Chrome and we have more problems when using Edge.

Are there known issues with Edge connecting to the Portal?

This screen shot shows what sometimes happens though this is just a particular RG. The squares will flash.  On Edge when clicking the Virtual Machines tab sometimes you see the names of the virtual machines along the left hand side and the other columns are only populated by these dots which continue to flash on and off. 


Monday, June 4, 2018 4:23 PM

There could be many possibilities because of which you might be facing this issue:

Suggest you to make sure edge browser is updated.

Clear the browser history and cache.

Could you press F12 and help us with the screenshot of the network trace.

Logout and login again on the Azure portal.

Can you try it on a different machine and check if this is machine specific issue?