Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] Fix delete immutable blob will give incorrect prompt #14691

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
BethanyZhou marked this conversation as resolved.
Show resolved Hide resolved
- `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