Bird
Raised Fist0
Azurecloud~5 mins

Storage redundancy (LRS, ZRS, GRS) in Azure - Commands & Configuration

Choose your learning style10 modes available
Introduction
Storage redundancy protects your data by keeping copies in different places. It helps avoid data loss if hardware fails or a whole data center has problems.
When you want to keep your data safe from hardware failures in a single server.
When you want to protect your data even if one whole building or data center goes offline.
When you want your data to be available quickly in the same region without delays.
When you want to keep a backup copy of your data in a different geographic area for disaster recovery.
When you want to balance cost and safety by choosing the right level of data protection.
Config File - storage-account-template.json
storage-account-template.json
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2022-09-01",
      "name": "examplestoracc",
      "location": "eastus",
      "sku": {
        "name": "Standard_LRS"
      },
      "kind": "StorageV2",
      "properties": {}
    }
  ]
}

This JSON file creates an Azure Storage Account named examplestoracc in the eastus region.

The sku.name sets the redundancy type. Here it is Standard_LRS which means locally redundant storage.

You can change sku.name to Standard_ZRS for zone-redundant storage or Standard_GRS for geo-redundant storage.

The kind is StorageV2 which supports all modern features.

Commands
This command creates a new Azure Storage Account named examplestoracc in the eastus region with locally redundant storage (LRS). It keeps three copies of your data in one data center.
Terminal
az storage account create --name examplestoracc --resource-group example-rg --location eastus --sku Standard_LRS --kind StorageV2
Expected OutputExpected
{ "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/example-rg/providers/Microsoft.Storage/storageAccounts/examplestoracc", "location": "eastus", "name": "examplestoracc", "sku": { "name": "Standard_LRS" }, "kind": "StorageV2", "statusOfPrimary": "available" }
→
--sku - Sets the redundancy type like LRS, ZRS, or GRS
→
--kind - Defines the storage account type, StorageV2 supports latest features
→
--location - Specifies the Azure region where data is stored
This command shows details of the storage account to verify it was created with the correct redundancy setting.
Terminal
az storage account show --name examplestoracc --resource-group example-rg
Expected OutputExpected
{ "name": "examplestoracc", "location": "eastus", "sku": { "name": "Standard_LRS" }, "kind": "StorageV2", "statusOfPrimary": "available" }
This command updates the storage account to use geo-redundant storage (GRS), which keeps copies in two different regions for extra safety.
Terminal
az storage account update --name examplestoracc --resource-group example-rg --sku Standard_GRS
Expected OutputExpected
{ "sku": { "name": "Standard_GRS" }, "name": "examplestoracc", "location": "eastus", "kind": "StorageV2" }
→
--sku - Changes the redundancy type
Verify the storage account now uses geo-redundant storage after the update.
Terminal
az storage account show --name examplestoracc --resource-group example-rg
Expected OutputExpected
{ "name": "examplestoracc", "location": "eastus", "sku": { "name": "Standard_GRS" }, "kind": "StorageV2", "statusOfPrimary": "available" }
Key Concept

If you remember nothing else from this pattern, remember: choose the right redundancy type (LRS, ZRS, or GRS) based on how much data safety and availability you need.

Common Mistakes
Using LRS when you need protection against entire data center failures
LRS only keeps copies in one data center, so if that center fails, data is lost
Use ZRS or GRS to keep copies across zones or regions for better protection
Not verifying the storage account SKU after creation
You might think you set GRS but actually created LRS, risking data loss
Always run 'az storage account show' to confirm the redundancy setting
Trying to change redundancy type to ZRS on an existing account that doesn't support it
Not all accounts can switch redundancy types freely, causing errors
Check Azure docs for supported SKU changes or create a new account with desired redundancy
Summary
Create an Azure Storage Account with a chosen redundancy type using 'az storage account create'.
Check the storage account details with 'az storage account show' to confirm redundancy.
Update the redundancy type if needed using 'az storage account update --sku'.
Choose redundancy based on your data safety and availability needs: LRS for local copies, ZRS for zone copies, GRS for geo copies.

Practice

(1/5)
1. Which Azure storage redundancy option keeps copies of your data only within a single data center?
easy
A. Zone-Redundant Storage (ZRS)
B. Read-Access Geo-Redundant Storage (RA-GRS)
C. Geo-Redundant Storage (GRS)
D. Locally Redundant Storage (LRS)

Solution

  1. Step 1: Understand LRS scope

    LRS keeps three copies of data within a single data center to protect against hardware failures.
  2. Step 2: Compare with other options

    ZRS replicates data across zones, GRS replicates across regions, so they are broader than LRS.
  3. Final Answer:

    Locally Redundant Storage (LRS) -> Option D
  4. Quick Check:

    Single data center copies = LRS [OK]
Hint: LRS = copies inside one data center only [OK]
Common Mistakes:
  • Confusing ZRS with LRS because both mention redundancy
  • Thinking GRS is inside one data center
  • Mixing RA-GRS with LRS
2. Which redundancy option is correctly written in Azure Storage configuration syntax?
easy
A. "redundancy": "ZRS"
B. "redundancy": "LZR"
C. "redundancy": "GRZ"
D. "redundancy": "RAGRS"

Solution

  1. Step 1: Identify valid redundancy codes

    Azure uses LRS, ZRS, GRS, and RA-GRS as standard redundancy codes.
  2. Step 2: Check each option

    "redundancy": "ZRS" uses "ZRS" which is valid. Others have incorrect or invalid codes.
  3. Final Answer:

    "redundancy": "ZRS" -> Option A
  4. Quick Check:

    Valid Azure redundancy code = ZRS [OK]
Hint: Use exact Azure codes: LRS, ZRS, GRS, RA-GRS [OK]
Common Mistakes:
  • Typos in redundancy codes like LZR or GRZ
  • Using unsupported codes
  • Confusing RA-GRS abbreviation
3. If you configure Azure Storage with redundancy: "GRS", what happens when the primary region fails?
medium
A. Data is available only if zones in the primary region are healthy
B. Data is lost because copies are only in one data center
C. Data is available from a secondary region copy
D. Data is immediately deleted from all regions

Solution

  1. Step 1: Understand GRS behavior

    GRS replicates data asynchronously to a secondary region for disaster recovery.
  2. Step 2: Effect of primary region failure

    If the primary region fails, data can be accessed from the secondary region copy.
  3. Final Answer:

    Data is available from a secondary region copy -> Option C
  4. Quick Check:

    GRS = secondary region copy available [OK]
Hint: GRS keeps copies in another region for failover [OK]
Common Mistakes:
  • Thinking GRS only copies inside one data center
  • Confusing zone redundancy with region redundancy
  • Assuming data is lost on primary failure
4. You set Azure Storage redundancy to "ZRS" but notice data is not replicated across zones. What is the likely cause?
medium
A. You must enable GRS for zone replication
B. ZRS is not supported in the selected region
C. LRS setting overrides ZRS automatically
D. Data replication only happens manually with ZRS

Solution

  1. Step 1: Check ZRS regional support

    ZRS requires the region to support availability zones; some regions do not support ZRS.
  2. Step 2: Understand replication behavior

    If the region lacks zone support, ZRS cannot replicate across zones, causing no zone replication.
  3. Final Answer:

    ZRS is not supported in the selected region -> Option B
  4. Quick Check:

    ZRS needs region with zones [OK]
Hint: ZRS needs region with zones enabled [OK]
Common Mistakes:
  • Confusing GRS with ZRS replication
  • Assuming LRS overrides ZRS
  • Thinking ZRS replication is manual
5. A company wants to minimize cost but needs protection against data center failure and regional disaster. Which Azure storage redundancy option should they choose?
hard
A. Geo-Redundant Storage (GRS)
B. Zone-Redundant Storage (ZRS)
C. Read-Access Geo-Redundant Storage (RA-GRS)
D. Locally Redundant Storage (LRS)

Solution

  1. Step 1: Analyze protection needs

    Protection against data center failure requires zone or local redundancy; regional disaster needs geo-redundancy.
  2. Step 2: Balance cost and protection

    LRS is cheapest but no regional protection; ZRS protects zones but not regions; GRS protects regions at moderate cost; RA-GRS adds read access but costs more.
  3. Final Answer:

    Geo-Redundant Storage (GRS) -> Option A
  4. Quick Check:

    Regional disaster + cost balance = GRS [OK]
Hint: GRS balances cost and regional disaster protection [OK]
Common Mistakes:
  • Choosing LRS which lacks regional protection
  • Picking RA-GRS which costs more than needed
  • Assuming ZRS protects against regional disasters
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard