Impossibile eliminare un blob di Azure perché ha un lease infinito su di esso. Attualmente sto provando a rompere quel contratto d'affitto usando il metodo BreakLease().Azure BreakLease restituisce 409 Errore di conflitto
Qui ci sono i comandi che sto eseguendo in PowerShell:
$StorageAccountName = "storage account name"
$ContainerName = "container name"
$BlobName = "blob name
[Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.Storage\Microsoft.WindowsAzure.Storage.dll")
$Keys = Get-AzureStorageKey -StorageAccountName $StorageAccountName
$StorageAccountKey = $Keys[0].Primary
$Creds = New-Object Microsoft.WindowsAzure.Storage.Auth.StorageCredentials($StorageAccountName,$StorageAccountKey)
$CloudStorageAccount = New-Object Microsoft.WindowsAzure.Storage.CloudStorageAccount($Creds, $true)
$CloudBlobClient = $CloudStorageAccount.CreateCloudBlobClient()
$BlobContainer = $CloudBlobClient.GetContainerReference($ContainerName)
$Blob = $BlobContainer.ListBlobs() | Where{$_.Name -eq $BlobName}
$Blob.Properties
$Blob.BreakLease($(New-TimeSpan), $null, $null, $null)
L'uscita proprietà BLOB è:
CacheControl :
ContentDisposition :
ContentEncoding :
ContentLanguage :
Length : 1098437886464
ContentMD5 :
ContentType : application/octet-stream
ETag : "0x8D33831477A9F90"
LastModified : 2/18/2016 7:01:09 AM +00:00
BlobType : PageBlob
LeaseStatus : Locked
LeaseState : Leased
LeaseDuration : Infinite
PageBlobSequenceNumber :
AppendBlobCommittedBlockCount :
Il messaggio di errore sul BreakLease() chiamata di metodo è:
Exception calling "BreakLease" with "4" argument(s): "The remote server returned an error: (409) Conflict."
At line:1 char:20
+ $Blob.BreakLease($(New-TimeSpan), $null, $null, $null)
+ ~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : StorageException
Qualche idea?