Skip to content

Commit 656a13a

Browse files
authored
Merge pull request #193167 from tamram/tamram22-0322
cross-account copy for rehydrating from archive tier
2 parents efeeb24 + cfa24f8 commit 656a13a

File tree

2 files changed

+98
-11
lines changed

2 files changed

+98
-11
lines changed

articles/storage/blobs/archive-rehydrate-overview.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: storage
55
author: tamram
66

77
ms.author: tamram
8-
ms.date: 03/01/2022
8+
ms.date: 04/15/2022
99
ms.service: storage
1010
ms.subservice: blobs
1111
ms.topic: conceptual
@@ -54,22 +54,24 @@ Microsoft recommends performing a copy operation in most scenarios where you nee
5454
- A copy operation avoids the early deletion fee that is assessed if you change the tier of a blob from the Archive tier before the required 180-day period elapses. For more information, see [Archive access tier](access-tiers-overview.md#archive-access-tier).
5555
- If there is a lifecycle management policy in effect for the storage account, then rehydrating a blob with [Set Blob Tier](/rest/api/storageservices/set-blob-tier) can result in a scenario where the lifecycle policy moves the blob back to the Archive tier after rehydration because the last modified time is beyond the threshold set for the policy. A copy operation leaves the source blob in the Archive tier and creates a new blob with a different name and a new last modified time, so there is no risk that the rehydrated blob will be moved back to the Archive tier by the lifecycle policy.
5656

57-
Copying a blob from the Archive tier can take hours to complete depending on the rehydration priority selected. Behind the scenes, a blob copy operation reads your archived source blob to create a new online blob in the selected destination tier. The new blob may be visible when you list the blobs in the parent container before the rehydration operation is complete, but its tier will be set to Archive, The data is not available until the read operation from the source blob in the Archive tier is complete and the blob's contents have been written to the new destination blob in an online tier. The new blob is an independent copy, so modifying or deleting it does not affect the source blob in the Archive tier.
57+
Copying a blob from the Archive tier can take hours to complete depending on the rehydration priority selected. Behind the scenes, a blob copy operation reads your archived source blob to create a new online blob in the selected destination tier. The new blob may be visible when you list the blobs in the parent container before the rehydration operation is complete, but its tier will be set to Archive. The data is not available until the read operation from the source blob in the Archive tier is complete and the blob's contents have been written to the new destination blob in an online tier. The new blob is an independent copy, so modifying or deleting it does not affect the source blob in the Archive tier.
5858

5959
To learn how to rehydrate a blob by copying it to an online tier, see [Rehydrate a blob with a copy operation](archive-rehydrate-to-online-tier.md#rehydrate-a-blob-with-a-copy-operation).
6060

6161
> [!IMPORTANT]
6262
> Do not delete the source blob until the rehydration has completed successfully. If the source blob is deleted, then the destination blob may not finish copying. You can handle the event that is raised when the copy operation completes to know when it is safe to delete the source blob. For more information, see [Handle an event on blob rehydration](#handle-an-event-on-blob-rehydration).
6363
64-
Copying an archived blob to an online destination tier is supported within the same storage account only. You cannot copy an archived blob to a destination blob that is also in the Archive tier.
64+
Rehydrating an archived blob by copying it to an online destination tier is supported within the same storage account only for service versions prior to 2021-02-12. Beginning with service version 2021-02-12, you can rehydrate an archived blob by copying it to a different storage account, as long as the destination account is in the same region as the source account. Rehydration across storage accounts enables you to segregate your production data from your backup data, by maintaining them in separate accounts. Isolating archived data in a separate account can also help to mitigate costs from unintentional rehydration.
65+
66+
The target blob for the copy operation must be in an online tier (Hot or Cool). You cannot copy an archived blob to a destination blob that is also in the Archive tier.
6567

6668
The following table shows the behavior of a blob copy operation, depending on the tiers of the source and destination blob.
6769

6870
| | **Hot tier source** | **Cool tier source** | **Archive tier source** |
6971
|--|--|--|--|
70-
| **Hot tier destination** | Supported | Supported | Supported within the same account. Requires blob rehydration. |
71-
| **Cool tier destination** | Supported | Supported | Supported within the same account. Requires blob rehydration. |
72-
| **Archive tier destination** | Supported | Supported | Unsupported |
72+
| **Hot tier destination** | Supported | Supported | Supported across accounts in the same region with version 2021-02-12 and later. Supported within the same storage account only for earlier versions. Requires blob rehydration. |
73+
| **Cool tier destination** | Supported | Supported | Supported across accounts in the same region with version 2021-02-12 and later. Supported within the same storage account only for earlier versions. Requires blob rehydration. |
74+
| **Archive tier destination** | Supported | Supported | Not supported |
7375

7476
## Change a blob's access tier to an online tier
7577

articles/storage/blobs/archive-rehydrate-to-online-tier.md

Lines changed: 90 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: tamram
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 03/01/2022
10+
ms.date: 04/15/2022
1111
ms.author: tamram
1212
ms.reviewer: fryu
1313
ms.custom: devx-track-azurepowershell
@@ -31,15 +31,19 @@ For more information about rehydrating a blob, see [Blob rehydration from the Ar
3131

3232
To rehydrate a blob from the Archive tier by copying it to an online tier, use PowerShell, Azure CLI, or one of the Azure Storage client libraries. Keep in mind that when you copy an archived blob to an online tier, the source and destination blobs must have different names.
3333

34+
Copying an archived blob to an online destination tier is supported within the same storage account. Beginning with service version 2021-02-12, you can copy an archived blob to a different storage account, as long as the destination account is in the same region as the source account.
35+
3436
After the copy operation is complete, the destination blob appears in the Archive tier. The destination blob is then rehydrated to the online tier that you specified in the copy operation. When the destination blob is fully rehydrated, it becomes available in the new online tier.
3537

36-
The following examples show how to copy an archived blob with PowerShell or Azure CLI.
38+
### Rehydrate a blob to the same storage account
3739

38-
### [Portal](#tab/azure-portal)
40+
The following examples show how to copy an archived blob to a blob in the Hot tier in the same storage account.
41+
42+
#### [Portal](#tab/azure-portal)
3943

4044
N/A
4145

42-
### [PowerShell](#tab/azure-powershell)
46+
#### [PowerShell](#tab/azure-powershell)
4347

4448
To copy an archived blob to an online tier with PowerShell, call the [Start-AzStorageBlobCopy](/powershell/module/az.storage/start-azstorageblobcopy) command and specify the target tier and the rehydration priority. Remember to replace placeholders in angle brackets with your own values:
4549

@@ -67,7 +71,7 @@ Start-AzStorageBlobCopy -SrcContainer $srcContainerName `
6771
-Context $ctx
6872
```
6973

70-
### [Azure CLI](#tab/azure-cli)
74+
#### [Azure CLI](#tab/azure-cli)
7175

7276
To copy an archived blob to an online tier with Azure CLI, call the [az storage blob copy start](/cli/azure/storage/blob/copy#az-storage-blob-copy-start) command and specify the target tier and the rehydration priority. Remember to replace placeholders in angle brackets with your own values:
7377

@@ -85,6 +89,87 @@ az storage blob copy start \
8589

8690
---
8791

92+
### Rehydrate a blob to a different storage account in the same region
93+
94+
The following examples show how to copy an archived blob to a blob in the Hot tier in a different storage account.
95+
96+
#### [Portal](#tab/azure-portal)
97+
98+
N/A
99+
100+
#### [PowerShell](#tab/azure-powershell)
101+
102+
To copy an archived blob to a blob in an online tier in a different storage account with PowerShell, make sure you have installed the [Az.Storage](https://www.powershellgallery.com/packages/Az.Storage/) module, version 4.4.0 or higher. Next, call the [Start-AzStorageBlobCopy](/powershell/module/az.storage/start-azstorageblobcopy) command and specify the target online tier and the rehydration priority. You must specify a shared access signature (SAS) with read permissions for the archived source blob.
103+
104+
The following example shows how to copy an archived blob to the Hot tier in a different storage account. Remember to replace placeholders in angle brackets with your own values:
105+
106+
```powershell
107+
$rgName = "<resource-group>"
108+
$srcAccount = "<source-account>"
109+
$destAccount = "<dest-account>"
110+
$srcContainer = "<source-container>"
111+
$destContainer = "<dest-container>"
112+
$srcBlob = "<source-blob>"
113+
$destBlob = "<destination-blob>"
114+
115+
# Get the destination account context
116+
$destCtx = New-AzStorageContext -StorageAccountName $destAccount -UseConnectedAccount
117+
118+
# Get the source account context
119+
$srcCtx = New-AzStorageContext -StorageAccountName $srcAccount -UseConnectedAccount
120+
121+
# Get the SAS URI for the source blob
122+
$srcBlobUri = New-AzStorageBlobSASToken -Container $srcContainer `
123+
-Blob $srcBlob `
124+
-Permission rwd `
125+
-ExpiryTime (Get-Date).AddDays(1) `
126+
-FullUri `
127+
-Context $srcCtx
128+
129+
# Start the cross-account copy operation
130+
Start-AzStorageBlobCopy -AbsoluteUri $srcBlobUri `
131+
-DestContainer $destContainer `
132+
-DestBlob $destBlob `
133+
-DestContext $destCtx `
134+
-StandardBlobTier Hot `
135+
-RehydratePriority Standard
136+
```
137+
138+
#### [Azure CLI](#tab/azure-cli)
139+
140+
To copy an archived blob to a blob in an online tier in a different storage account with the Azure CLI, make sure you have installed version 2.35.0 or higher. Next, call the [az storage blob copy start](/cli/azure/storage/blob/copy#az-storage-blob-copy-start) command and specify the target online tier and the rehydration priority. You must specify a shared access signature (SAS) with read permissions for the archived source blob.
141+
142+
The following example shows how to copy an archived blob to the Hot tier in a different storage account. Remember to replace placeholders in angle brackets with your own values:
143+
144+
```azurecli
145+
# Specify the expiry interval
146+
end=`date -u -d "1 day" '+%Y-%m-%dT%H:%MZ'`
147+
148+
# Get a SAS for the source blob
149+
srcBlobUri=$(az storage blob generate-sas \
150+
--account-name <source-account> \
151+
--container <source-container> \
152+
--name <archived-source-blob> \
153+
--permissions rwd \
154+
--expiry $end \
155+
--https-only \
156+
--full-uri \
157+
--as-user \
158+
--auth-mode login | tr -d '"')
159+
160+
# Copy to the destination blob in the Hot tier
161+
az storage blob copy start \
162+
--source-uri $srcBlobUri \
163+
--account-name <dest-account> \
164+
--destination-container <dest-container> \
165+
--destination-blob <dest-blob> \
166+
--tier Hot \
167+
--rehydrate-priority Standard \
168+
--auth-mode login
169+
```
170+
171+
---
172+
88173
## Rehydrate a blob by changing its tier
89174

90175
To rehydrate a blob by changing its tier from Archive to Hot or Cool, use the Azure portal, PowerShell, or Azure CLI.

0 commit comments

Comments
 (0)