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:
| Setting | Values | Changeable later? |
|---|---|---|
| Performance | Standard (HDD-backed, all services) / Premium (SSD, one service per account) | no: copy to a new account |
| Kind | StorageV2 (general purpose v2, the default for almost everything), BlockBlobStorage (premium blobs), FileStorage (premium file shares) | no |
| Redundancy | LRS, ZRS, GRS, RA-GRS, GZRS, RA-GZRS | yes: some by update, some by a conversion |
| Default access tier | Hot, Cool, Cold (per blob also Archive) | yes |
| Encryption | always on (AES-256); Microsoft-managed keys or customer-managed keys | the 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
| SKU | Copies | Survives | Read from the secondary |
|---|---|---|---|
| LRS | 3 in one datacenter | a disk or rack failure | - |
| ZRS | 3 across 3 availability zones | a zone outage, with no failover | - |
| GRS | LRS + async LRS copy in the paired region | a region outage, after a failover | only after failover |
| RA-GRS | as GRS | as GRS | always (<name>-secondary endpoint) |
| GZRS / RA-GZRS | ZRS + async LRS copy in the paired region | a zone outage and a region outage | RA-: 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
| Tier | For | Minimum storage period (early deletion charge) | Reading |
|---|---|---|---|
| Hot | data read often | none | immediate, cheapest per read |
| Cool | read rarely, kept 30+ days | 30 days | immediate, more per read |
| Cold | read very rarely, kept 90+ days | 90 days | immediate, even more per read |
| Archive (per blob only) | kept 180+ days, hours of delay are fine | 180 days | offline: 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:
- The Key Vault has soft delete and purge protection on (so the key can't vanish in minutes).
- The storage account has a managed identity, and that identity has Key Vault Crypto Service Encryption User on the key (wrap/unwrap only).
- 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.