Overview and What You Will Learn
In this lab, you will create Storage Accounts with different replication options, compare their guarantees directly, and understand exactly what each option protects against - so a disaster recovery decision is based on the actual failure scenario being protected against, not just picking the option with the most letters in its name.
Why This Matters in Production
A team at a fintech assumes their data is safe because "it's in the cloud," without checking what replication option their Storage Account actually uses. If that account uses only Locally Redundant Storage and the entire physical datacenter it lives in becomes unavailable, every copy of that data - all three of them - is unavailable at the same time, since all three copies live in the same building.
Core Principles
Azure Storage replication options differ in how many copies of your data exist and where those copies physically live.
+------------------------------------------+| LRS - Locally Redundant Storage || 3 copies, same datacenter || Protects against: single disk/node failure || Does NOT protect against: datacenter loss |+------------------------------------------+| ZRS - Zone-Redundant Storage || 3 copies, separate datacenters in the same || region || Protects against: single datacenter loss |+------------------------------------------+| GRS - Geo-Redundant Storage || LRS copies in primary region PLUS async || replicated copies in a secondary region || Protects against: entire region loss |+------------------------------------------+RA-GRS (Read-Access Geo-Redundant Storage) extends GRS by allowing read access to the secondary region's copy even while the primary region is healthy - useful for read scaling, not just disaster recovery.
Detailed Step-by-Step Practical Lab
- Create a Resource Group:
az group create --name rg-replication-lab-mumbai --location centralindia- Create a Storage Account using LRS - the baseline, cheapest option:
az storage account create \ --name streplicationlrs \ --resource-group rg-replication-lab-mumbai \ --location centralindia \ --sku Standard_LRS- Create a second Storage Account using ZRS, protecting against a single datacenter failure:
az storage account create \ --name streplicationzrs \ --resource-group rg-replication-lab-mumbai \ --location centralindia \ --sku Standard_ZRS- Create a third Storage Account using GRS, adding a secondary region copy:
az storage account create \ --name streplicationgrs \ --resource-group rg-replication-lab-mumbai \ --location centralindia \ --sku Standard_GRS- Compare the replication setting across all three accounts:
az storage account list \ --resource-group rg-replication-lab-mumbai \ --query "[].name" --output table az storage account list \ --resource-group rg-replication-lab-mumbai \ --query "[].sku.name" --output table- Check which secondary region GRS automatically paired with the primary region:
az storage account show \ --name streplicationgrs \ --resource-group rg-replication-lab-mumbai \ --query "secondaryLocation" --output tsvNoteAzure automatically pairs each region with a specific secondary region for GRS replication - you do not choose the secondary region yourself, it is determined by which region your primary Storage Account is created in.
- Clean up:
az group delete --name rg-replication-lab-mumbai --yes --no-waitProduction Best Practices & Common Pitfalls
Common MistakeAssuming LRS provides adequate disaster recovery because "there are three copies of the data." All three LRS copies live in the same physical datacenter - if that datacenter becomes unavailable, all three copies are unavailable simultaneously. LRS protects against hardware failure, not datacenter-level disasters.
TipChoose replication based on the actual failure scenario your business needs to survive, not by defaulting to the most expensive option "to be safe." An internal, easily-regenerated dataset may only need LRS; a critical financial record likely needs GRS or better.
- GRS replication to the secondary region is asynchronous. During a real regional failure, there is a small window of the most recent writes that may not have replicated yet - GRS protects against total data loss, not against losing the very last few seconds of writes before a disaster.
- RA-GRS adds read access to the secondary copy at extra cost. Only choose it if you specifically need to read from the secondary region during normal operation, not purely for the disaster recovery guarantee, which plain GRS already provides.
Quick Reference & Troubleshooting Commands
| Command | Description |
|---|---|
az storage account create --sku Standard_LRS |
Create an account with local-only replication |
az storage account create --sku Standard_ZRS |
Create an account replicated across datacenters in-region |
az storage account create --sku Standard_GRS |
Create an account replicated to a secondary region |
az storage account show --query "secondaryLocation" |
Check which secondary region GRS is paired with |