Azure - Error deleting VHD: There is currently a lease on the blob and no lease ID was specified in the request.

Working with Azure the last couple of days, I came across an issue where I deleted a VM but I was unable to delete the associated vhd blob. The error received was similar to this:

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

While this error is expected if a VHD is still registered as a disk or image in the portal, the problem arises where a lease remains even if the blob is not registered as a disk or image in the azure portal.

If you receive one of these errors, first make sure the VHD is not in use (i.e deleted):

  • In the Windows Azure management portal, if the disk shows up under Virtual Machines, Disks, and the Attached To column is not blank, you should first remove that VM in the Attached To column by going to VM Instances, selecting the VM, then clicking Delete.

  • If Attached To is blank or the VM in the Attached To column has already been removed, try removing the disk by highlighting it under Disks and clicking **Delete Disk **(this will not physically delete the VHD from the blob storage, it only removes the disk object in the portal). Example image below

Azure VM Disks

Useful Tip: You can use the magnifying glass to filter to the required disk if you have multipleĀ pages of disks.

Happy Codingā€¦


  • Share this post on