Loading...

Monitor Object Replication Status For Storage Account

Monitor Object Replication Status For Storage Account

Object replication asynchronously copies block blobs between a source storage account and a destination account. Because block blob data is replicated asynchronously, the source account and destination account are not immediately in sync. There's currently no SLA on how long it takes to replicate data to the destination account. In some cases, you might need to check the replication status, in this article we will go over the different methods that you can use to check and monitor the object replication status for the storage account.

 

Using Azure Portal

To check the replication status for a blob in the source account in the Azure portal, follow these steps:

  1. Navigate to the source account in the Azure portal.
  2. Locate the container that includes the source blob.
  3. Select the blob to display its properties. If the blob has been replicated successfully, you'll see in the Object replication section that the status is set to Complete. The replication policy ID and the ID for the rule governing object replication for this container are also listed

HaithamQaffesha_4-1678714679008.png

 

Using Rest API

 

We can utilize the Get Blob Properties API to return all the replication details for a specific blob, you can construct the Get Blob Properties request as follows.

 

 

 

 

 

https://myaccount.blob.core.windows.net/mycontainer/myblob

 

 

 

 

 

The response header for the request header will contain the following details about the object replication:

x-ms-or-{policy-id}_{rule-id} Version 2019-12-12 and later, returned only for block blobs. policy-id is a GUID value that represents the identifier of an object replication policy on the storage account. rule-id is a GUID value that represents the identifier of a policy rule on the blob container. If the account is ObjectReplication-enabled, the value of this header represents the replication status of blob with the given policy and rule identifiers, either complete or failed.
x-ms-or-policy-id Version 2019-12-12 and later, returned only for block blobs. If the account is ObjectReplication-enabled, the value of this header represents the policy that governs the replication.
 
For more details about how to create the Get Blob Properties API request please refer to the following documentation: Get Blob Properties (REST API) - Azure Storage | Microsoft Learn
 

Using Diagnostic Logs

You can monitor the object replication status for multiple blobs using Log Analytics Workspace queries by checking the storage account for the copy operation from source storage to the destination storage account. The following steps can be used to achieve this:

 

  1. Enable log analytics on the target account with a diagnostic setting for blobs and with write operations: https://docs.microsoft.com/en-us/azure/storage/blobs/monitor-blob-storage?tabs=azure-portal#send-logs-to-azure-log-analytics
  2. Setup your object replication rule for source and destination: HaithamQaffesha_5-1678716891827.png
  3. Go to query the log analytics workspace with the following query:StorageBlobLogs | where OperationName == "CopyBlob" | where StatusCode in (200,201,202) | where UserAgentHeader contains "ObjectReplication"

     

    • Operation name will be CopyBlob
    • To filter for successful replication operations, you can check status code 200-202, for failed replication operation you can filter by StatusCode > 400
    • the UserAgentHeader will contain ObjectReplication 

Successful object replication sample:

Screenshot 2023-03-13 173109.png

Failed object replication sample:

 Screenshot 2023-03-13 174643.png

 

You would be able to create alerts for different events with a similar approach from the logs analytic workspace: https://docs.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-log 

 

 

 

 

Published on:

Learn more
Azure PaaS Blog articles
Azure PaaS Blog articles

Azure PaaS Blog articles

Share post:

Related posts

Azure Storage - TLS 1.0 and 1.1 retirement

Overview TLS 1.0 and 1.1 retirement on Azure Storage was previously announced for Nov 1st, 2024, and it was postponed recently to 1 year later...

1 year ago

Efficient Management of Append and Page Blobs Using Azure Storage Actions

  Overview In Azure Storage, Blob Lifecycle Management (BLM) allows you to automate the management of your data based on rules defined by...

1 year ago

[Azure AI Search] Internal Server Error when creating CMK encrypted objects

Scenario Customers follow the Microsoft doc to create CMK encrypted objects (data source, index etc.), but get the 500 Internal Serv...

1 year ago

Optimizing Azure Table Storage: Automated Data Cleanup using a PowerShell script with Azure Automate

Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...

1 year ago

Optimizing Azure Table Storage: Automated Data Clean-up using a PowerShell script with Azure Automat

Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...

1 year ago

Restoring Soft-Deleted Blobs with multithreading in Azure Storage Using C#

Blob soft delete is an essential feature that safeguards your data against accidental deletions or overwrites. By retaining deleted data for a...

1 year ago

Performing simple Azure Table Storage REST API operations using curl command.

The blog provides guidance to perform simple Table Storage REST API operations such as Create table, Delete Table, Insert entity, Delete entit...

1 year ago

Bulk delete all the old jobs from the batch account

Deleting a Job also deletes all Tasks that are part of that Job, and all Job statistics. This also overrides the retention period for Task dat...

1 year ago

Utilizing Azure Storage and Runbooks for scheduled automated backups of Azure SQL Databases

In this article, we are going to provide detailed steps to create a scheduled Azure SQL Database backup to storage account using automation. T...

2 years ago

[Azure Service Bus] JMS messages getting dead-lettered

The article discusses a problem where numerous messages end up in the dead letter queue (DLQ) when the JMS service bus consumer connects to th...

2 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.