0
0
Azurecloud~5 mins

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

Choose your learning style9 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.