Could you explain me how to delete BLOBs with blocked lease? I have error message after try to delete: There is currently a lease on the blob and no lease ID was specified in the request. Property of Lease of that BLOBs objects is: Blocked
-
Have you confirmed you deleted all disks associated with the blob? See my answer [here](http://stackoverflow.com/a/34364494/272109) which shows how to see all disk objects associated with blobs. – David Makogon May 03 '16 at 00:06
4 Answers
The article has a power shell script to unlock the lease of the blob files
https://msdn.microsoft.com/en-us/library/jj919145.aspx?f=255&MSPPError=-2147217396
Exract from the link
When backing up to or restoring from Windows Azure storage, SQL Server acquires an infinite lease in order to lock exclusive access to the blob. When the backup or restore process is successfully completed, the lease is released. If a backup or restore fails, the backup process attempts to clean up any invalid blob. However, if the backup fails due to prolonged or sustained network connectivity failure, the backup process may not be able gain access to the blob and the blob may remain orphaned. This means that the blob cannot be written to or deleted until the lease is released. This topic describes how to release the lease and deleting the blob

- 3,028
- 8
- 48
- 98
Azure Blob API support breaking the lease
https://msdn.microsoft.com/en-us/library/azure/ee691972.aspx
if you are using client library, look for those method.
or simply implement your own, below is blog post contains sample code that from Steve Marx
http://blog.smarx.com/posts/leasing-windows-azure-blobs-using-the-storage-client-library

- 3,621
- 1
- 15
- 14
-
No, it just created BLOBs in azure interface... But cant delete right now – Vladimir Rubtsov May 02 '16 at 20:04
-
not following. let me ask one question: do you want to delete your blob grammatically or manually? – Xiaomin Wu May 02 '16 at 20:44
I had this same problem and was able to delete the VHD blob through the old portal (manage.windowsazure.com).
Under the Storage blade, navigate to your storage account, click on containers, select the container, then select the VHD blob and click delete.
You will get the message stating that there is a lease on the blob, but you should also see an option to delete the disk and the blob. Select that, and it should delete the VHD blob (as well as the orphaned disk).

- 332
- 4
- 10
I just came to know that this can also be done from the Azure Storage Explorer tool(version: 0.8.13). Navigate to your .vhd file and right click where you will see 'Break Lease' option. This should do the trick.

- 203
- 1
- 10