You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to configure object replication to asynchronously copy block blobs from a container in one storage account to another.
5
5
services: storage
6
6
author: tamram
7
7
@@ -24,14 +24,15 @@ This article describes how to configure object replication for your storage acco
24
24
25
25
Before you configure object replication, create the source and destination storage accounts if they do not already exist. Both accounts must be general-purpose v2 storage accounts. For more information, see [Create an Azure Storage account](../common/storage-account-create.md).
26
26
27
-
# [Azure portal](#tab/portal)
27
+
Also, make sure that you have registered for the following feature previews:
28
28
29
-
Before you configure object replication in the Azure portal, create the source and destination containers in their respective storage accounts, if they do not already exist.
-[Change feed support in Azure Blob Storage (Preview)](storage-blob-change-feed.md)
30
32
31
-
Next, make sure you have enabled the following prerequisites:
33
+
# [Azure portal](#tab/portal)
32
34
33
-
-[Change feed (preview)](storage-blob-change-feed.md) on the source account
34
-
-[Blob versioning (preview)](versioning-overview.md) on the source and destination accounts
35
+
Before you configure object replication in the Azure portal, create the source and destination containers in their respective storage accounts, if they do not already exist. Also, enabled blob versioning and change feed on the source account, and enable blob versioning on the destination account.
35
36
36
37
To create a replication policy in the Azure portal, follow these steps:
To create a replication policy with Azure CLI, first install version [1.14.1-preview](https://www.powershellgallery.com/packages/Az.Storage/1.14.1-preview) of the Az.Storage PowerShell module. Follow these steps to install the preview module:
156
+
To create a replication policy with Azure CLI, first install version ??? of the Azure CLI. For more information, see [Install the Azure CLI](/cli/azure/install-azure-cli).
162
157
163
-
Refer to [Install the Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest) article to install and import the preview module supporting object replication capability.
158
+
Run the following command to install the Azure Storage preview module for Azure CLI:
164
159
160
+
```azurecli
165
161
az extension add -n storage-ors-preview
162
+
```
166
163
167
-
To start working with Azure CLI, sign in with your Azure credentials.
164
+
Next, sign in with your Azure credentials:
168
165
166
+
```azurecli
169
167
az login
168
+
```
170
169
171
-
Enable both Change feed and Versioning on the source storage account. Make sure you’re already registered for [Change feed](https://azure.microsoft.com/blog/change-feed-support-now-available-in-preview-for-azure-blob-storage/) and Versioning capabilities.
Create a new replication policy and an associated rule(s) and specify the desired prefix and replication behavior for the objects, that existed prior to configuring object replication.
Change the source account name by updating the existing replication policy.
230
-
231
-
az storage account ors-policy update \\
232
-
233
-
\--policy-id \$policyid \\
170
+
Enable blob versioning on the source and destination storage accounts, and enable change feed on the source account. Make sure that you have already registered for the [change feed](https://azure.microsoft.com/blog/change-feed-support-now-available-in-preview-for-azure-blob-storage/) and Versioning capabilities.
234
171
235
-
\--account-name \<destination storage account\>\\
172
+
```azurecli
173
+
az storage blob service-properties update --resource-group <resource-group> \
174
+
--account-name <source-storage-account> \
175
+
--enable-versioning
236
176
237
-
\--resource-group \<resource group\>\\
177
+
az storage blob service-properties update --resource-group <resource-group> \
178
+
--account-name <source-storage-account> \
179
+
--enable-change-feed
238
180
239
-
\-s \<new source storage account\>
181
+
az storage blob service-properties update --resource-group <resource-group> \
182
+
--account-name <dest-storage-account> \
183
+
--enable-versioning
184
+
```
240
185
241
-
Add rule to an existing replication policy.
186
+
Create the source and destination containers in their respective storage accounts.
242
187
243
-
az storage account ors-policy rule add \\
188
+
```azurecli
189
+
az storage container create --account-name <source-storage-account> --name source-container3 --auth-mode login
190
+
az storage container create --account-name <source-storage-account> --name source-container4 --auth-mode login
244
191
245
-
\--policy-id \$policyid \\
192
+
az storage container create --account-name <dest-storage-account> --name source-container3 --auth-mode login
193
+
az storage container create --account-name <dest-storage-account> --name source-container4 --auth-mode login
194
+
```
246
195
247
-
\--account-name \<destination storage account\>\\
196
+
Create a new replication policy and associated rules on the destination account.
197
+
198
+
```azurecli
199
+
az storage account or-policy create --account-name <dest-storage-account> \
200
+
--resource-group <resource-group> \
201
+
--source-account <source-storage-account> \
202
+
--destination-account <dest-storage-account> \
203
+
--source-container source-container3 \
204
+
--destination-container dest-container3 \
205
+
--min-creation-time '2020-05-10T00:00:00Z' \
206
+
--prefix-match a
207
+
208
+
az storage account or-policy rule add --account-name <dest-storage-account> \
209
+
--destination-container dest-container4 \
210
+
--policy-id <policy-id> \
211
+
--resource-group <resource-group> \
212
+
--source-container source-container4 \
213
+
--prefix-match b
214
+
```
248
215
249
-
\--resource-group \<resource group\>\\
216
+
Create the policy on the source account using the policy ID.
To remove a replication policy, delete the policy from both the source account and the destination account. Deleting the policy also deletes any rules associated with it.
268
245
269
-
When no longer needed, remove the replication policy from the source and
To remove a replication policy, delete the policy from both the source account and the destination account. Deleting the policy also deletes any rules associated with it.
0 commit comments