A quick tip for anyone who gets stuck when trying to delete an Azure Blob Storage Container that appears to be empty but upon deletion generates the following helpful error message

There is currently a lease on the container and no lease ID was specified in the request…

You’ve looked and there are no VHD or other objects appearing in this Container and you have found that you are unable to change the lease settings on the Container (yes, you can read them but you can’t update or remove them).

This is a little gotcha and is all down to Virtual Machine Images.

If you have created any Machine Images their VHDs will be held in a Blob Container but will not show up as other blobs – you will need to switch to the Virtual Machines > Images tab (shown below as I delete my old Images) in order to delete or otherwise update the Image so you can remove the Container.

Delete VM Images

Hope this helps you save a few minutes in your day!

Category:
Azure Infrastructure, Cloud Infrastructure
Tags:
, ,

Join the conversation! 7 Comments

  1. I was getting the same error and had to open a tech support ticket each time. It took several days them to figure out. It was this summer so maybe they learned how to fix the cause.

    Reply
  2. […] Fix: unable to delete an Azure Storage Container due to a lease. […]

    Reply
  3. Thanks, mate, you’ve really helped me. Cheers

    Reply
  4. Create a new VM pointing to the existing VHD if you have more VHD with the same problem you may atach one to this VM. When you are finish delete the virtual machin MAKE SURE you delete the atthached VHDs.

    Reply
  5. Thanks for this. If anyone is looking where to find Images under the new Windows Azure portal, you need to navigate to ‘VM Images (classic)’, since you can no longer find it under ‘Virtual Machines’ or ‘Virtual Machines (classic).

    Reply
  6. Thank you. This was a mystery before finding your post.

    Reply
  7. Thanks đŸ™‚

    Reply

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

%d bloggers like this: