Ich kann ein Azure-Blob nicht löschen, da es über eine unendliche Lease verfügt. Ich versuche nun, diese Lease mit der BreakLease() -Methode zu brechen.Azure BreakLease gibt 409 zurück Konfliktfehler
Hier sind die Befehle, die ich in Power Ausführen bin:
$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)
Die BLOB Eigenschaft Ausgabe ist:
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 :
Die Fehlermeldung auf dem BreakLease() Methodenaufruf ist:
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
Irgendwelche Ideen?