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
Copy file name to clipboardExpand all lines: articles/storage/blobs/object-replication-configure.md
+32-13Lines changed: 32 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,6 +215,10 @@ az storage account or-policy show \
215
215
--policy "@-"
216
216
```
217
217
218
+
### [REST API](#tab/rest-api)
219
+
220
+
N/A
221
+
218
222
---
219
223
220
224
## Configure object replication using a JSON file
@@ -228,7 +232,7 @@ For information about how to author a JSON file that contains the policy definit
228
232
229
233
The examples in this section show how to configure the object replication policy on the destination account, and then get the JSON file for that policy that another user can use to configure the policy on the source account.
230
234
231
-
# [Azure portal](#tab/portal)
235
+
###[Azure portal](#tab/portal)
232
236
233
237
To configure object replication on the destination account with a JSON file in the Azure portal, follow these steps:
234
238
@@ -257,7 +261,7 @@ The downloaded JSON file includes the policy ID that Azure Storage created for t
257
261
258
262
Keep in mind that uploading a JSON file to create a replication policy for the destination account via the Azure portal doesn't automatically create the same policy in the source account. Another user must create the policy on the source account before Azure Storage begins replicating objects.
259
263
260
-
# [PowerShell](#tab/powershell)
264
+
###[PowerShell](#tab/powershell)
261
265
262
266
To download a JSON file that contains the replication policy definition for the destination account from PowerShell, call the [Get-AzStorageObjectReplicationPolicy](/powershell/module/az.storage/get-azstorageobjectreplicationpolicy) command to return the policy. Then convert the policy to JSON and save it as a local file, as shown in the following example. Remember to replace values in angle brackets and the file path with your own values:
To write the replication policy definition for the destination account to a JSON file from Azure CLI, call the [az storage account or-policy show](/cli/azure/storage/account/or-policy#az-storage-account-or-policy-show) command and output to a file.
290
294
@@ -305,23 +309,27 @@ az storage account or-policy create \
305
309
--policy @policy.json
306
310
```
307
311
312
+
### [REST API](#tab/rest-api)
313
+
314
+
N/A
315
+
308
316
---
309
317
310
318
## Configure replication metrics
311
319
312
320
### Enable replication metrics
313
321
You can enable replication metrics on both new and existing object replication policies. It might take a few minutes to start observing the metrics.
314
322
315
-
# [Azure Portal](#tab/azure-portal)
323
+
####[Azure Portal](#tab/azure-portal)
316
324
You can enable metrics using **Object Replication** blade from the new _Metrics_ column or by editing the _Edit Rules_ section of a policy from "…" on the OR policy row.
317
325
318
-
# [PowerShell](#tab/powershell)
326
+
####[PowerShell](#tab/powershell)
319
327
Not yet supported.
320
328
321
-
# [Azure CLI](#tab/azure-cli)
329
+
####[Azure CLI](#tab/azure-cli)
322
330
Not yet supported.
323
331
324
-
# [REST API](#tab/rest-api)
332
+
####[REST API](#tab/rest-api)
325
333
Enabling metrics is supported on API version 2021-08-01 and above. You can add the new metrics field to the replication policy. Sample:
326
334
```json
327
335
{
@@ -341,8 +349,11 @@ Enabling metrics is supported on API version 2021-08-01 and above. You can add t
341
349
]
342
350
}
343
351
```
352
+
344
353
---
354
+
345
355
If you enable metrics on a policy that is configured to copy over existing data, you might observe an increasing amount at the beginning while the policy works on initial phase of listing. Once this is completed, the replication will start.
356
+
346
357
### View replication metrics
347
358
348
359
You can click the **View** link from Metrics column to view monitoring metrics
@@ -353,7 +364,7 @@ To further view metrics in Azure Monitor, click on chart of a metric. This will
353
364
354
365
You can check the replication status for a blob in the source account using the Azure portal, PowerShell, or Azure CLI. Object replication properties aren't populated until replication has either completed or failed.
355
366
356
-
# [Azure portal](#tab/portal)
367
+
###[Azure portal](#tab/portal)
357
368
358
369
To check the replication status for a blob in the source account in the Azure portal, follow these steps:
359
370
@@ -363,7 +374,7 @@ To check the replication status for a blob in the source account in the Azure po
363
374
364
375
:::image type="content" source="media/object-replication-configure/check-replication-status-source.png" alt-text="Screenshot showing replication status for a blob in the source account":::
365
376
366
-
# [PowerShell](#tab/powershell)
377
+
###[PowerShell](#tab/powershell)
367
378
368
379
To check the replication status for a blob in the source account with PowerShell, get the value of the object replication **ReplicationStatus** property, as shown in the following example. Remember to replace values in angle brackets with your own values:
To check the replication status for a blob in the source account with Azure CLI, get the value of the object replication **status** property, as shown in the following example:
382
393
@@ -398,11 +409,15 @@ If the replication status for a blob in the source account indicates failure, th
398
409
- Verify that the destination container still exists.
399
410
- If the source blob has been encrypted with a customer-provided key as part of a write operation, then object replication will fail. For more information about customer-provided keys, see [Provide an encryption key on a request to Blob storage](encryption-customer-provided-keys.md).
400
411
412
+
### [REST API](#tab/rest-api)
413
+
414
+
N/A
415
+
401
416
## Remove a replication policy
402
417
403
418
To remove a replication policy and its associated rules, use Azure portal, PowerShell, or CLI.
404
419
405
-
# [Azure portal](#tab/portal)
420
+
###[Azure portal](#tab/portal)
406
421
407
422
To remove a replication policy in the Azure portal, follow these steps:
408
423
@@ -411,7 +426,7 @@ To remove a replication policy in the Azure portal, follow these steps:
411
426
1. Select the **More** button next to the policy name.
412
427
1. Select **Delete Rules**.
413
428
414
-
# [PowerShell](#tab/powershell)
429
+
###[PowerShell](#tab/powershell)
415
430
416
431
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.
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.
433
448
@@ -443,6 +458,10 @@ az storage account or-policy delete \
0 commit comments