Skip to content

Commit

Permalink
[Storage] Fix delete immutable blob will give incorrect prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
blueww committed Apr 7, 2021
1 parent eb67590 commit d6fd5fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed an issue that delete immutable blob will prompt incorrect message.
- `Remove-AzStorageAccount`
* Fixed copy blob fail with source context as Oauth [#14662]
- `Start-AzStorageBlobCopy`

Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Storage/Blob/Cmdlet/RemoveAzureStorageBlob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ internal async Task RemoveAzureBlob(long taskId, IStorageBlobManagement localCha
}
catch (StorageException e)
{
if (e.IsConflictException() && retryDeleteSnapshot)
if (e.IsConflictException() && e.RequestInformation.ErrorCode.Equals("SnapshotsPresent", StringComparison.InvariantCultureIgnoreCase) && retryDeleteSnapshot)
{
//If x-ms-delete-snapshots is not specified on the request and the blob has associated snapshots, the Blob service returns status code 409 (Conflict).
retryDeleteSnapshot = true;
Expand Down

0 comments on commit d6fd5fc

Please sign in to comment.