DEV Community

Cover image for Object Replication of Azure Blobs.
Saswat Sambit
Saswat Sambit

Posted on • Updated on

Object Replication of Azure Blobs.

Azure Blob storage is Microsoft's object storage solution for the cloud. Blob storage is optimized for storing massive amounts of unstructured data. Unstructured data is data that doesn't adhere to a particular data model or definition, such as text or binary data.

FAQ

  1. What is a Replication Rule?
    A replication rule is a rule to replicate objects from a container in a storage account to another.
    The rule is attached to the storage account which has different parameters, but most importantly the Destination storage account.
    The rule automatically replicates the objects to the destination container whenever we upload something to the source container.

  2. What do we mean by cross-region?
    Cross-region here means that our containers in the storage accounts are deployed in different regions. Here I deployed a container in us-east but I want to the replicate the objects to another container deployed in australia-southeast

  3. Why do we need a Replication between the storage accounts?
    Mainly for Disaster Recovery (DR). Whenever the bucket hosted in our primary datacenter goes down, we can immediately and easily reroute to our secondary datacenter which can be in the same zone or some other zone/region.


Creating my Source Storage Account and a Source Container in it.

  • Create a Storage Account, name it something like 'sourcestorage-20YYMMDD'.
    source-storage-account

  • Now go to the 'Containers' in the Left Pane of the Source Storage Account and select the '+ Container'.
    +container

  • Name the container and select 'Create'.
    create-container
    Container is created!
    container-created


Creating my Destination Storage Account and a Destination Container in it.

  • Create another Storage Account, I named it 'destination20220823' [Note: Character length restriction while naming] P.s. I created this Storage account in australia-southeast region while my source storage account was in us-east region.

destination-storage-account

  • Similar to the Source container creation, create a container in the Destination storage account. destination-container Destination container is created!

Creating a Replication rule.

Now we will create a replication rule which will replicate objects from the Source container in the Storage Storage Account to the Destination container in the Destination Storage Account.

  • Go to the Source Storage Account, and there proceed to Object replication option under the Data management section in the Left Pane. Then select 'Create Replication rules'
    object-replication

  • Now select your destination storage account and fill up the container pair details. In my case I paired my source container 'sourcecontainer-20220823' to my destination container 'destination20220823'.
    my-replication-rule

  • As we can see that the replication rule is successfully attached.
    replication-rule-success


Testing the Replication rule.

  • Uploading a file to the source container 'sourcecontainer-20220823'
    upload-file

  • We can see that the file is successfully uploaded to the source container.
    file-upload-success

  • In about 2~3mins, the file is successfully replicated to the destination container.
    file-replication-success

Top comments (0)