【发布时间】:2019-07-19 20:09:26
【问题描述】:
在备份到该容器之前,我需要删除特定容器中的所有 blob。以下不起作用。这样做的正确方法是什么?
Get-AzStorageBlob -Container $ContainerName -Context $ctx | Remove-AzStorageBlob -DeleteSnapshot -Force
对于 Get-AzStorageBlob 返回的每个 blob,我都会收到以下错误消息:
Remove-AzStorageBlob : The specified blob does not exist. HTTP Status Code: 404 - HTTP Error Message: The specified blob does not exist.
ErrorCode: BlobNotFound
ErrorMessage: The specified blob does not exist.
RequestId:eb2612f4-f01e-0067-5471-3e9f69000000
Time:2019-07-19T20:33:50.1261168Z
At line:15 char:62
+ ... inerName -Context $ctx | Remove-AzStorageBlob -DeleteSnapshot -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Remove-AzStorageBlob], StorageException
+ FullyQualifiedErrorId : StorageException,Microsoft.WindowsAzure.Commands.Storage.Blob.RemoveStorageAzureBlobCommand
【问题讨论】:
-
您能解释一下您所说的“不起作用”是什么意思吗?是没有删除任何 blob 还是仅删除了一些 blob?
-
删除并重新创建存储容器会更简单吗?
-
除非它是空的,否则我认为我不能删除它。另外,我看不出有任何理由这不应该起作用,这让我很烦恼:)
标签: azure powershell azure-powershell