Delete an storage account containing an leased blob

Yesterday, I provisioned a couple of Azure VMs and provisioned them in a new storage account. In the end, I deleted the virtual machines and associated images and then tried to delete the newly created storage account. However the request to delete the storage account failed.

On the classic portal, https://manage.windowsazure.com, nothing happened when clicking delete button. On the new resource manager portal, https://portal.azure.com, when I delete the storage account, I got this error:

Failed to delete storage account 'ddportalvhdss3zc5vtxqstw'. Unable to delete 
storage account 'ddportalvhdss3zc5vtxqstw': 'Storage account 
ddportalvhdss3zc5vtxqstw contains VM Images. 
Ensure these VM Images are removed before deleting this storage account.'.

Trying to delete the blob itself (a 136 GB VHD) on Azure Storage Explorer I got this error:

There is currently a lease on the blob and no lease ID was specified 
in the request.

When checking the lease duration, it was infinitely leased:

Leased duration for blob
Leased duration for blob

Since VMs and associated images already stands deleted leaving disks as orphan, there was nothing to do from VM options.

I couldn’t find a way to do it from the portal. So I end up using azure-cli, and after authentication, ran the following commands:

azure storage account delete

Voila, it completed successfully:

storage account deletion using azure cli
storage account deletion using azure cli

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s