diff --git a/src/Storage/Storage.Management/ChangeLog.md b/src/Storage/Storage.Management/ChangeLog.md index f8c7ad3bbc46..b665b407c1ba 100644 --- a/src/Storage/Storage.Management/ChangeLog.md +++ b/src/Storage/Storage.Management/ChangeLog.md @@ -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` diff --git a/src/Storage/Storage/Blob/Cmdlet/RemoveAzureStorageBlob.cs b/src/Storage/Storage/Blob/Cmdlet/RemoveAzureStorageBlob.cs index de07fa5cb0d8..6015b33f3811 100644 --- a/src/Storage/Storage/Blob/Cmdlet/RemoveAzureStorageBlob.cs +++ b/src/Storage/Storage/Blob/Cmdlet/RemoveAzureStorageBlob.cs @@ -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;