From fd39e526092d11e2e5305ffd1048551ce0e5faef Mon Sep 17 00:00:00 2001 From: Wei Wei Date: Thu, 9 Jan 2020 11:16:16 +0800 Subject: [PATCH 1/4] [Storage] Fix the exception handle --- src/Storage/Storage.Management/ChangeLog.md | 1 + src/Storage/Storage/Common/StorageExceptionUtil.cs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/Storage/Storage.Management/ChangeLog.md b/src/Storage/Storage.Management/ChangeLog.md index 6aa8376c75fd..085af21037a9 100644 --- a/src/Storage/Storage.Management/ChangeLog.md +++ b/src/Storage/Storage.Management/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Show RequestId when StorageException don't have ExtendedErrorInformation ## Version 1.11.0 * Add breaking change warning message for DefaultAction Value change in a future release diff --git a/src/Storage/Storage/Common/StorageExceptionUtil.cs b/src/Storage/Storage/Common/StorageExceptionUtil.cs index ad4adbd855ee..b86224c5a9b5 100644 --- a/src/Storage/Storage/Common/StorageExceptionUtil.cs +++ b/src/Storage/Storage/Common/StorageExceptionUtil.cs @@ -97,6 +97,16 @@ public static StorageException RepackStorageException(this StorageException e) } msg += extendErrorInfo; } + else + { + String errorInfo = String.Format( + "\nErrorCode: {0}\nErrorMessage: {1}\nRequestId: {2}\nTime: {3}", + e.RequestInformation.ErrorCode, + e.RequestInformation.HttpStatusMessage, + e.RequestInformation.ServiceRequestID, + e.RequestInformation.RequestDate); + msg += errorInfo; + } e = new StorageException(e.RequestInformation, msg, e); } return e; From 0ebd89b3e1ef30efa4cd8033c644bf7cc0d96ef4 Mon Sep 17 00:00:00 2001 From: Xin Huang Date: Wed, 8 Jan 2020 12:03:41 -0800 Subject: [PATCH 2/4] missing command --- src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md b/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md index fd34e6aeb935..9def224f6a6b 100644 --- a/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md +++ b/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md @@ -163,7 +163,7 @@ The command starts the copy operation in the context stored in $Context. ### Example 6: Copy a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Archive, RehydratePriority as High ``` -C:\PS>Start-AzStorageBlobCopy -SrcContainer "ContosoUploads" -SrcBlob "BlockBlobName" -DestContainer "ContosoArchives" -DestBlob "NewBlockBlobName" -StandardBlobTier Archive +C:\PS>Start-AzStorageBlobCopy -SrcContainer "ContosoUploads" -SrcBlob "BlockBlobName" -DestContainer "ContosoArchives" -DestBlob "NewBlockBlobName" -StandardBlobTier Archive -RehydratePriority High ``` This command starts the copy operation of a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Archive, RehydratePriority as High From 9d1d032c976cb9bf7af3d59aabbac66e691ec5d8 Mon Sep 17 00:00:00 2001 From: Xin Huang Date: Wed, 8 Jan 2020 14:56:29 -0800 Subject: [PATCH 3/4] Destination blob cannot be archive If using RehydratePriority, then the source blob is already in archive. Destination blob cannot also be in archive with copyblob --- .../Storage.Management/help/Start-AzStorageBlobCopy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md b/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md index 9def224f6a6b..dd6325bf93dd 100644 --- a/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md +++ b/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md @@ -161,12 +161,12 @@ This command creates a context for the account named ContosoGeneral that uses th The second command copies the file from the specified URI to the blob named ContosoPlanning in the container named ContosoArchive. The command starts the copy operation in the context stored in $Context. -### Example 6: Copy a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Archive, RehydratePriority as High +### Example 6: Copy a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Hot, RehydratePriority as High ``` -C:\PS>Start-AzStorageBlobCopy -SrcContainer "ContosoUploads" -SrcBlob "BlockBlobName" -DestContainer "ContosoArchives" -DestBlob "NewBlockBlobName" -StandardBlobTier Archive -RehydratePriority High +C:\PS>Start-AzStorageBlobCopy -SrcContainer "ContosoUploads" -SrcBlob "BlockBlobName" -DestContainer "ContosoArchives" -DestBlob "NewBlockBlobName" -StandardBlobTier Hot -RehydratePriority High ``` -This command starts the copy operation of a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Archive, RehydratePriority as High +This command starts the copy operation of a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Hot, RehydratePriority as High ## PARAMETERS From 45b7e7f5b3069223a72963b265e5cd45e03d5078 Mon Sep 17 00:00:00 2001 From: Wei Wei Date: Thu, 9 Jan 2020 11:24:50 +0800 Subject: [PATCH 4/4] Add change log --- src/Storage/Storage.Management/ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Storage/Storage.Management/ChangeLog.md b/src/Storage/Storage.Management/ChangeLog.md index 085af21037a9..1cca60b83c14 100644 --- a/src/Storage/Storage.Management/ChangeLog.md +++ b/src/Storage/Storage.Management/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release * Show RequestId when StorageException don't have ExtendedErrorInformation +* Fix the Example 6 of cmdlet Start-AzStorageBlobCopy ## Version 1.11.0 * Add breaking change warning message for DefaultAction Value change in a future release