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

后端 未结 4 1229
太阳男子
太阳男子 2021-01-04 02:10

When I attempt to delete a blob from my storage account container, I get an error message, \"There is currently a lease on the blob and no lease ID was specified in

相关标签:
4条回答
  • 2021-01-04 02:25

    You need to delete the disks from the Virtual Machines section of the portal.

    • Navigate to Virtual Machines -> Disks
    • Delete the disks

    Check this MSDN blog post for the complete instructions: http://blogs.msdn.com/b/windows_azure_technical_support_wats_team/archive/2013/02/05/iaas-unable-to-delete-vhd-there-is-currently-a-lease-on-the-blob.aspx

    0 讨论(0)
  • 2021-01-04 02:34

    You should have images associated to your VMs. Even if you have deleted your VMs, the images have to be explicitly deleted.

    Once the images are deleted, you should see VHD getting cleared as well

    0 讨论(0)
  • 2021-01-04 02:42

    Alternatively, you can just kill the lease on the Blobs with PowerShell:

    (Get-AzureRmStorageAccount -Name "STORAGE_ACCOUNT_NAME" | Get-AzureStorageBlob -name "CONTAINER_NAME").ICloudBlob.BreakLease()
    

    Just realize when you do this, the VM's that use this storage will not be able to turn on. (And you should turn them off if they aren't already before you do this.

    However, if you might use the VM's again in the future this technique allows you to:

    1. Stop the VM in question.
    2. Download a copy of the VHD.
    3. Release the lease on the VHD
    4. Delete the VHD in the storage account.
    5. Insert arbitrary time period where you don't need the VM
    6. Upload the VHD to the same storage account with the same container and same file name.
    7. Start the VM back up and have it work :-).
    0 讨论(0)
  • 2021-01-04 02:44

    There is an alternate (easier) way to break a lease if you use (or download) Microsoft Azure Storage Explorer (a really cool tool to manage Azure Storage).

    You can browse to the Storage Account and find the relevant file (vhd) and then select the Break Lease option.

    The same CAUTIONS above apply and the Explorer tool makes these clear.

    0 讨论(0)
提交回复
热议问题