2
votes

I'll begin by referencing two other questions that have partial answers to this issue.

Delete disk from Azure after VM deleted

How can I delete a leased blob in Microsoft Azure storage

Using Azure Explorer I was able to delete the blobs and containers, but when I attempt to delete the storage account I get this error:

Failed to delete storage account 'bitnamiwestusflwdmy'. Unable to delete storage account 'bitnamiwestusflwdmy': 'Storage account bitnamiwestusflwdmy has some active image(s) and/or disk(s), e.g. bitnami-bitnami-gitlab-8.2.3-3-westus-FLwDm_Y. Ensure these image(s) and/or disk(s) are removed before deleting this storage account.'.

This is strange because Azure Portal shows the account has zero containers, queues and tables; Azure Explorer displays "this folder is empty" for the contents of the storage account.

It appears that there is no way to delete two empty storage accounts in my Azure account. Neither contains any images or disks, yet an error message suggests they do. If they exist, they aren't visible through any management tool available for Azure. Nobody is able to give a complete answer to the question of deleting storage accounts from Azure.


Here I would like to comment on the failed suggestions from those two referenced questions.

In the new portal (portal.azure.com) you'll find the disks under OS Disks (classic) :

In fact, OS disks shows "Nothing to Display" despite the fact that I have two storage accounts that I can't delete due to active disks.

http://portal.azure.com Storage Accounts (Classic) does not allow these accounts to be deleted.

Azure Storage Explorer allowed me to delete blobs, but not containers, disks or accounts.

While Azure Explorer worked for deleting the contents of my storage account, I wasn't able to do this until the lease was broken. In order to delete the images in my storage accounts through Azure Explorer I had to first right click on them and select "break lease" from the context menu. I had to do this for the contents of the image and then the image itself. This was how I emptied the accounts. Still, the storage accounts themselves can't be deleted.

2

2 Answers

2
votes

Can you confirm that you don't have anything registered in the section below ?

enter image description here

0
votes

I had the following error when trying to delete the storage account - after deleting everything else:

Failed to delete storage account 'portalvhds5nqky61nhdlrg'. Error: Unable to delete storage account 'portalvhds5nqky61nhdlrg': 'Storage account portalvhds5nqky61nhdlrg contains VM Images. Ensure these VM Images are removed before deleting this storage account.'. But I couldn't see any VM Images in the Storage Account (in either portal) or using Storage Explorer.

But Emmanuel's answer above gave me a clue - Using the Classic Portal, click on 'Virtual Machines' (even if it shows 0) and then select 'Images' - which got me to the same screen as what Emmanuel has above.

I then switched to using the Azure CLI, and after setting it to the correct account I tried the following commands:

azure vm image show <the VM Image name from the Classic Portal>

From that I could confirm the details, then:

azure vm image delete <the VM Image name from the Classic Portal>

Which eventually deleted the VM Image.

Then, finally, I could go back to either portal and delete the storage account.