Assume we have a replication enabled for a blob container with another target container. What happens when we delete a blob in the replicated / target blob container? Will it the deleted ? Or will the blob recreated /replicated in target container ?

Satheesh K 20 Reputation points
2024-05-30T03:39:40.47+00:00

Assume we have a replication enabled for a blob container with another target container. What happens when we delete a blob in the replicated / target blob container directly? Will it the deleted? Or will the blob be recreated /replicated again in target container since the source container has the blob?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,557 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anand Prakash Yadav 7,540 Reputation points Microsoft Vendor
    2024-05-31T06:04:55.19+00:00

    Hello Satheesh K,

    Thank you for posting your query here!

    When you have replication enabled for a blob container with a target container in Azure Blob Storage, the behavior of what happens when you delete a blob directly in the target container depends on the type of replication mechanism you are using.

    Types of Replication in Azure Blob Storage

    Geo-Redundant Storage (GRS) / Read-Access Geo-Redundant Storage (RA-GRS): These replication types replicate your data to a secondary region to ensure durability and availability in case of a regional outage. The secondary region is read-only in the case of RA-GRS and not accessible directly in GRS.

    Deletion Impact: Since you cannot directly access or delete blobs in the secondary region, this scenario does not apply here.

    Geo-Zone-Redundant Storage (GZRS) / Read-Access Geo-Zone-Redundant Storage (RA-GZRS):

    These provide enhanced availability and durability by combining replication across availability zones within a region and across a secondary region.

    Similar to GRS, you do not directly interact with the replicas, so deletion in the target container is not applicable.

    Azure Data Share / Azure Storage Account Failover:

    Data Share allows sharing data between storage accounts, but this is not automatic replication.

    Storage Account Failover allows you to initiate a failover to the secondary region, making it the primary region, but this is a manual process.

    Object Replication:

    Object Replication in Azure Blob Storage asynchronously copies blobs between two storage accounts. This replication is controlled using replication policies.

    Deletion Impact: With Object Replication, the scenario is more applicable. If you delete a blob in the target container, the blob is not automatically recreated or re-replicated from the source container. Replication is one-way and does not continuously monitor the target container for deletions.

    Object Replication Detailed Behavior:

    Source Container: The original container where the blobs are stored.

    Target Container: The container where blobs are replicated to.

    Deletion Scenario with Object Replication:

    If you delete a blob in the target container:

    The replication policy does not automatically re-replicate the blob from the source container to the target container.

    The deleted blob in the target container remains deleted unless the replication policy is triggered again for new changes in the source container. However, existing blobs (which were replicated before the deletion) are not re-replicated.

    If you delete a blob in the source container:

    The deletion will propagate to the target container based on the replication policy. The blob will be deleted in the target container to keep it in sync with the source.

    So, when you delete a blob directly in the target container with object replication enabled, the blob will not be recreated or re-replicated from the source container. The deletion is considered a final action unless new changes in the source container trigger the replication policy again, but this will not include previously deleted blobs.

    Do let us know if you have any further queries. I’m happy to assist you further.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Amrinder Singh 3,795 Reputation points Microsoft Employee
    2024-05-30T05:11:57.8433333+00:00

    Hi Satheesh K - Thanks for reaching out.

    I assume you are referring to Object Replication configuration between source and destination container.

    If you delete a blob in the source the same gets replicated in the destination i.e. the blob in the destination container gets deleted.

    https://learn.microsoft.com/en-us/azure/storage/blobs/object-replication-overview#deleting-a-blob-in-the-source-account

    For the deletion operation to happen in destination first, I'll review this one once for the behavior and update this ahead.

    1 person found this answer helpful.