Skip to content

Commit e7d15f4

Browse files
bluewwSirfame Lin
authored andcommitted
[Storage] Fix delete immutable blob will give incorrect prompt (Azure#14691)
1 parent 9fd34d2 commit e7d15f4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fixed an issue that delete immutable blob will prompt incorrect message.
22+
- `Remove-AzStorageAccount`
2123
* Fixed copy blob fail with source context as Oauth [#14662]
2224
- `Start-AzStorageBlobCopy`
2325

src/Storage/Storage/Blob/Cmdlet/RemoveAzureStorageBlob.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ internal async Task RemoveAzureBlob(long taskId, IStorageBlobManagement localCha
181181
}
182182
catch (StorageException e)
183183
{
184-
if (e.IsConflictException() && retryDeleteSnapshot)
184+
if (e.IsConflictException() && e.RequestInformation.ErrorCode.Equals("SnapshotsPresent", StringComparison.InvariantCultureIgnoreCase) && retryDeleteSnapshot)
185185
{
186186
//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).
187187
retryDeleteSnapshot = true;

0 commit comments

Comments
 (0)