OnCallReadyStart learning

Azure Lesson 32.21 · Azure IV: Governance, Storage & Backup · 21 min read

Storage accounts in depth: performance, redundancy, tiers and encryption

In plain words

A storage account is a warehouse. When you build it you decide what kind (fast shelves or cheap ones - Premium or Standard), how many copies of every box to keep and where (one building, three buildings in the same town, or also a copy in another city), and which shelf new boxes go on by default (hot near the door, cool further back, archive in the basement where fetching takes hours).

Everything inside is locked in safes. You decide whether the warehouse company holds the safe keys or you do.

Storage accounts in depth: performance, redundancy, tiers and encryption

Azure I used a storage account as a place to put blobs and Terraform state. This lesson is about the decisions made when the account is created, because several of them can't be changed later without copying the data to a new account: the performance tier, the kind, how many copies exist and where, the default access tier, and whose key encrypts the data. Most "we lost data" and "the bill doubled" storage stories start with one of these.

Need to know:

SettingValuesChangeable later?
PerformanceStandard (HDD-backed, all services) / Premium (SSD, one service per account)no: copy to a new account
KindStorageV2 (general purpose v2, the default for almost everything), BlockBlobStorage (premium blobs), FileStorage (premium file shares)no
RedundancyLRS, ZRS, GRS, RA-GRS, GZRS, RA-GZRSyes: some by update, some by a conversion
Default access tierHot, Cool, Cold (per blob also Archive)yes
Encryptionalways on (AES-256); Microsoft-managed keys or customer-managed keysthe key source yes; infrastructure encryption no

The account name is global (it becomes https://<name>.blob.core.windows.net): 3-24 characters, lowercase letters and digits only.

Creating one with intent

$ az group create -n rg-try-data -l westeurope -o none
$ az storage account create -n sttrydata01 -g rg-try-data -l westeurope --sku Standard_LRS --kind StorageV2 --access-tier Hot --min-tls-version TLS1_2 --allow-blob-public-access false --query "{name:name, sku:sku.name, kind:kind, tier:accessTier, tls:minimumTlsVersion, httpsOnly:enableHttpsTrafficOnly}"
{
  "httpsOnly": true,
  "kind": "StorageV2",
  "name": "sttrydata01",
  "sku": "Standard_LRS",
  "tier": "Hot",
  "tls": "TLS1_2"
}
$ az storage account create -n sttrydata02 -g rg-try-data --sku Premium_LRS --kind BlockBlobStorage --query "{sku:sku.name, kind:kind}"
{
  "kind": "BlockBlobStorage",
  "sku": "Premium_LRS"
}

--sku carries both performance and redundancy (Premium_LRS). Premium is for latency-sensitive small-object workloads and high-transaction file shares, and it has no Cool or Archive tier. Secure defaults worth setting every time: TLS 1.2 minimum, HTTPS only, no anonymous blob access.

Redundancy: where the copies live

SKUCopiesSurvivesRead from the secondary
LRS3 in one datacentera disk or rack failure-
ZRS3 across 3 availability zonesa zone outage, with no failover-
GRSLRS + async LRS copy in the paired regiona region outage, after a failoveronly after failover
RA-GRSas GRSas GRSalways (<name>-secondary endpoint)
GZRS / RA-GZRSZRS + async LRS copy in the paired regiona zone outage and a region outageRA-: always

The geo copy is asynchronous: the secondary is behind by the Last Sync Time (usually minutes, with no SLA on it). What was written after that time is lost if you fail over.

$ az storage account update -n sttrydata01 -g rg-try-data --sku Standard_RAGRS --query "{sku:sku.name, secondary:secondaryLocation, readEndpoint:secondaryEndpoints.blob}"
{
  "readEndpoint": "https://sttrydata01-secondary.blob.core.windows.net/",
  "secondary": "northeurope",
  "sku": "Standard_RAGRS"
}
$ az storage account show -n sttrydata01 -g rg-try-data --expand geoReplicationStats --query geoReplicationStats
{
  "canFailover": true,
  "canPlannedFailover": true,
  "lastSyncTime": "2026-09-22T19:56:04+00:00",
  "postFailoverRedundancy": "Standard_LRS",
  "postPlannedFailoverRedundancy": "Standard_RAGRS",
  "status": "Live"
}

Changing redundancy has two paths:

  • Update (immediate): LRS, GRS and RA-GRS can be switched among themselves with az storage account update --sku.
  • Conversion (hours to days, the account stays online): anything that adds or removes zone redundancy (to or from ZRS, GZRS, RA-GZRS) is a migration you start and watch.
  • Never between Standard and Premium: that is a new account and an AzCopy.
$ az storage account update -n sttrydata01 -g rg-try-data --sku Standard_GZRS
ERROR: (InvalidRequestPropertyValue) Changing the redundancy from Standard_RAGRS to Standard_GZRS adds or removes zone redundancy, which is a conversion, not an update. Start it with: az storage account migration start --account-name sttrydata01 -g rg-try-data --sku Standard_GZRS (it takes hours to days; the account stays online).
Code: InvalidRequestPropertyValue
Message: Changing the redundancy from Standard_RAGRS to Standard_GZRS adds or removes zone redundancy, which is a conversion, not an update. Start it with: az storage account migration start --account-name sttrydata01 -g rg-try-data --sku Standard_GZRS (it takes hours to days; the account stays online).
$ az storage account migration start -n sttrydata01 -g rg-try-data --sku Standard_RAGZRS --no-wait --query migrationStatus -o tsv
SubmittedForConversion
$ az storage account migration show -n sttrydata01 -g rg-try-data --query "{status:migrationStatus, target:targetSkuName}"
{
  "status": "InProgress",
  "target": "Standard_RAGZRS"
}

Failover

If the primary region is down, a customer-managed failover makes the secondary the primary:

  • Unplanned (az storage account failover): DNS for the endpoints moves to the secondary, data after the Last Sync Time is lost, and the account is LRS in its new region until you re-enable geo-redundancy (which re-copies everything).
  • Planned (--failover-type Planned): both regions healthy, primary and secondary swap with no data loss. Use it for DR drills and region moves.
  • Microsoft-managed failover happens only in a region-wide disaster, if Microsoft declares it. Don't build your DR plan on it.

Access tiers

TierForMinimum storage period (early deletion charge)Reading
Hotdata read oftennoneimmediate, cheapest per read
Coolread rarely, kept 30+ days30 daysimmediate, more per read
Coldread very rarely, kept 90+ days90 daysimmediate, even more per read
Archive (per blob only)kept 180+ days, hours of delay are fine180 daysoffline: rehydrate to Hot/Cool/Cold first, up to 15 hours (Standard) or under 1 hour (High priority)

The account's default tier applies to blobs that don't have one set. Changing it moves those blobs' billing tier, which can mean a big transaction bill on a large account. Per-blob tiers and lifecycle rules (the data protection lesson) are the usual tools. Archive is not available on ZRS, GZRS or RA-GZRS accounts, or on Premium.

$ az storage account update -n sttrydata01 -g rg-try-data --access-tier Cool --query accessTier -o tsv
Cool

Encryption

Everything written to Azure Storage is encrypted at rest with AES-256 (Storage Service Encryption), always. You can't turn it off. The choice is whose key protects it:

$ az storage account show -n sttrydata01 -g rg-try-data --query "encryption.{source:keySource, infra:requireInfrastructureEncryption, blob:services.blob.enabled}"
{
  "blob": true,
  "infra": false,
  "source": "Microsoft.Storage"
}
  • Microsoft-managed keys (Microsoft.Storage): the default, nothing to do.
  • Customer-managed keys (CMK, Microsoft.Keyvault): your key in Key Vault (or Managed HSM) wraps the account's encryption key. You control rotation, and revoking access to the key makes the data unreadable: a compliance requirement in banking and health, and a way to lock yourself out.
  • Infrastructure encryption: a second layer, with a different algorithm and key, at the infrastructure level. Only at creation (--require-infrastructure-encryption).
  • Encryption scopes: different keys for different containers or blobs in one account.

CMK has prerequisites, and each one has its own error:

  1. The Key Vault has soft delete and purge protection on (so the key can't vanish in minutes).
  2. The storage account has a managed identity, and that identity has Key Vault Crypto Service Encryption User on the key (wrap/unwrap only).
  3. Someone with a key role (Key Vault Crypto Officer) created the key.
$ az keyvault create -n kv-try-data -g rg-try-data -l westeurope --enable-purge-protection true --retention-days 7 -o none
$ KV=$(az keyvault show -n kv-try-data --query id -o tsv)
$ az role assignment create --assignee [email protected] --role "Key Vault Crypto Officer" --scope $KV -o none
$ az keyvault key create --vault-name kv-try-data -n st-cmk --kty RSA --size 3072 --query key.kid -o tsv
https://kv-try-data.vault.azure.net/keys/st-cmk/07477fe04cc9124b05969eb6bde2678e
$ az storage account update -n sttrydata01 -g rg-try-data --encryption-key-source Microsoft.Keyvault --encryption-key-vault https://kv-try-data.vault.azure.net --encryption-key-name st-cmk -o none
ERROR: (InvalidRequestPropertyValue) (simulator) The storage account needs a managed identity to reach the key vault: --assign-identity (system) or --identity-type UserAssigned --user-identity-id ... and --key-vault-user-identity-id.
Code: InvalidRequestPropertyValue
Message: (simulator) The storage account needs a managed identity to reach the key vault: --assign-identity (system) or --identity-type UserAssigned --user-identity-id ... and --key-vault-user-identity-id.
$ az storage account update -n sttrydata01 -g rg-try-data --assign-identity --query identity.type -o tsv
SystemAssigned
$ az role assignment create --assignee $(az storage account show -n sttrydata01 -g rg-try-data --query identity.principalId -o tsv) --role "Key Vault Crypto Service Encryption User" --scope $KV -o none
$ az storage account update -n sttrydata01 -g rg-try-data --encryption-key-source Microsoft.Keyvault --encryption-key-vault https://kv-try-data.vault.azure.net --encryption-key-name st-cmk --query "encryption.{source:keySource, key:keyVaultProperties.keyName, version:keyVaultProperties.keyVersion}"
{
  "key": "st-cmk",
  "source": "Microsoft.Keyvault",
  "version": null
}

keyVersion: null means automatic key rotation: the account follows the newest version of the key (within about a day of rotation). Pin a version only if your compliance process requires it, and then rotation is your job.

On the exam (AZ-104 2.2.1, 2.2.2, 2.2.4, 2.3.3): account kinds and performance, which redundancy survives what, update vs conversion vs "new account", failover (unplanned vs planned, data loss after the last sync time, LRS afterwards), access tiers and their minimum periods, Archive rehydration, CMK prerequisites (soft delete + purge protection, managed identity, the crypto role), infrastructure encryption only at creation.

In an interview: "Which redundancy would you choose for a storage account holding production data?" - "It depends on what it must survive. ZRS keeps three copies in three zones, so a zone outage is invisible, with no failover. If the data must survive losing the region, GZRS adds an asynchronous copy in the paired region, and RA-GZRS lets me read it at any time. The copy lags by the last sync time, so a failover can lose recent writes. Backups and soft delete are still needed: redundancy copies deletes too."

What you can now do

  • Create an account with the right performance, kind, tier and secure defaults.
  • Pick a redundancy for a requirement and change it by update or conversion.
  • Explain failover, the last sync time and what you lose.
  • Set up customer-managed keys with their three prerequisites.

Why it helps

Several of these choices can't be changed later without copying all the data, and the redundancy choice decides what a zone or region outage does to you. Redundancy conversions, failover and its data loss, Archive rehydration and customer-managed keys are where real outages and failed audits come from.

They are also among the most tested storage topics on the AZ-104.

Commands in this lesson

az

FAQ

Does GRS protect me from deleting data by mistake?

No. Redundancy copies every change, deletes included, to every copy. Protection against deletes and overwrites comes from soft delete, versioning and backups. A script that deletes a container in a GZRS account deletes it in all six copies within minutes. Redundancy is about availability; recovery from mistakes is a different set of features.

Can I change redundancy later?

Between LRS, GRS and RA-GRS with a simple update. Adding or removing zone redundancy (ZRS, GZRS, RA-GZRS) is a conversion you start with az storage account migration start, which can take hours to days while the account stays online. Standard to Premium or back is never possible: copy the data to a new account.

What do I lose in a storage account failover?

In an unplanned (customer-managed) failover, everything written after the last sync time, which you can read in geoReplicationStats. Afterwards the account is LRS in its new region until you enable geo-redundancy again. A planned failover, with both regions healthy, swaps them with no loss.

Why can't I read a blob in the Archive tier?

Archive is offline storage. You rehydrate the blob to Hot, Cool or Cold first (set-tier with a rehydrate priority) or copy it to an online tier: up to 15 hours at Standard priority, usually under an hour at High.

What happens if the customer-managed key is deleted?

The account can no longer unwrap its encryption key and the data becomes unreadable. That is why CMK requires soft delete and purge protection on the Key Vault, and why key expiry, access and rotation need monitoring.

In an interview Mid

Which redundancy would you choose for a production storage account, and why?

It depends on what it must survive. ZRS keeps three copies in three availability zones, so a zone outage is invisible with no failover. If it must survive a region loss, GZRS adds an asynchronous copy in the paired region, and RA-GZRS lets me read that copy at any time. The geo copy lags by the last sync time, so a failover can lose recent writes. And redundancy is not backup: deletes replicate too, so soft delete, versioning and Azure Backup still matter.

Also asked: What is the difference between LRS, ZRS and GRS? · What are the access tiers and when would you use Archive? · What do you need to use customer-managed keys with a storage account?

Practise this lesson in the terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.