Error deleting VHD: There is currently a lease on the Blob and no lease ID was specified in the request
If you encounter with this error while trying to delete a storage account most probably it is because you created a Windows Azure Virtual Machine and removed it. In my case I was deleting a bunch of VMs and Windows Azure is set up to conserve the Hard Drive. (You can use existing OS DISKs to recreate an existing Virtual Machines. For this purpose, if you delete a Virtual Machines OS DISK is not deleted automatically.) The result is a bunch of hard drives in your storage account that if you try to delete directly from the storage account you might run across a “There is currently a lease on the Blob” error. Sure enough after a while the lease is released and you can delete it from the Storage Account but there is a better way:
If you go to the Disks section in Virtual Machines you can see the left over disk. So the way to go is to delete the Virtual Disk and from there the linked Blob in storage:
- Go to the management portal (manage.windowsazure.com).
- Click on Virtual Machines.
- Click on Disks.
- Click on the Disk you are trying to delete. You can see there all the Disks that are not attached to a VM at the moment.
- Click on Delete Disk.