Create and Configure Storage Accounts and Encryption
30-second answer
A storage account is created with a globally unique name (3 to 24 lowercase letters and numbers), a region, a performance tier (Standard general-purpose v2, or Premium block blobs, file shares or page blobs) and a redundancy option. Secure defaults to keep: secure transfer (HTTPS) required, minimum TLS 1.2, anonymous blob access off. All data is encrypted at rest with AES-256 automatically. You choose Microsoft-managed keys or customer-managed keys in Azure Key Vault or Managed HSM (the vault needs soft delete and purge protection, and the account needs a managed identity with access to the key). Infrastructure encryption adds a second layer and can only be enabled at creation.
Simulate it » No Azure account neededExam objective: 2.2.1 Create and configure storage accounts. 2.2.4 Configure storage account encryption. (Skills measured as of April 17, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Search for <strong>storage accounts</strong>.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Search for storage accounts.
- Type storage accounts in the search bar and pick Storage accounts under Services.
- Select + Create.
- Basics: the name becomes part of the URL. Performance can’t change later. Redundancy can.
- Advanced: keep anonymous access off and TLS 1.2. The account’s default access tier can be Hot, Cool or Cold.
- Networking: limit the public endpoint to selected networks now, or use private endpoints only.
- Data protection: the portal turns on soft delete by default. The CLI doesn’t, so check it there.
- Encryption: data is always encrypted with AES-256. Infrastructure (double) encryption and key support for tables and queues can only be chosen now.
- Review and select Create.
- Go to the resource.
- Later, switch to a customer-managed key under Encryption. The account’s managed identity needs Key Vault Crypto Service Encryption User on the key.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Encryption at rest
Azure Storage always encrypts data with AES-256. By default Microsoft manages the key. With a customer-managed key in Key Vault (soft delete and purge protection on), the account’s managed identity wraps and unwraps its data key with your key, and you can revoke it.
🤔 What happens if…
Read this tour as text
- The front door: the storage firewall. Every account has a public endpoint that accepts all networks by default. Set the default action to Deny and only what you list gets in: virtual network rules (subnets with the Microsoft.Storage service endpoint), IP rules (public addresses only) and trusted Azure services if you tick the exception.
- Three ways in, plus one for file shares. Callers prove who they are with an account key (full control), a SAS (limited rights for limited time) or a Microsoft Entra ID token checked against RBAC data roles. For SMB file shares, users bring a Kerberos ticket from AD DS, Microsoft Entra Domain Services or Microsoft Entra Kerberos.
- SAS tokens and stored access policies. A service SAS can point at a stored access policy on the container (up to 5 per container). The policy holds the permissions and expiry, so deleting or editing it revokes every SAS that names it. An ad hoc SAS can only be revoked by regenerating the key that signed it.
- Rotate access keys. Each account has two keys so you can rotate without downtime: move apps to key2, regenerate key1, and next time do the reverse. A key expiration policy flags old keys. Regenerating a key kills every SAS signed with it.
- Encryption at rest. Azure Storage always encrypts data with AES-256. By default Microsoft manages the key. With a customer-managed key in Key Vault (soft delete and purge protection on), the account’s managed identity wraps and unwraps its data key with your key, and you can revoke it.
- Redundancy and a region outage. LRS keeps 3 copies in one datacenter, ZRS spreads 3 across availability zones, GRS adds an async copy in the paired region and GZRS combines both. RA- versions let you read the secondary. A customer-managed failover promotes the secondary when the primary region is down.
- Moving data: AzCopy and object replication. AzCopy moves files in parallel from the command line, signed in with Microsoft Entra ID (and a Storage Blob Data role) or with a SAS. Storage Explorer does the same with a GUI. Object replication keeps copying new block blobs to another account by itself.
- Access tiers and lifecycle management. Blobs sit in Hot, Cool (30-day minimum), Cold (90 days) or Archive (180 days, offline). A lifecycle management rule moves or deletes blobs by age or last access, about once a day. Reading an archived blob means rehydrating it first.
- Undo buttons: soft delete, versioning and snapshots. Blob soft delete and container soft delete keep deleted items for 1 to 365 days. Versioning keeps every previous version of a blob. For Azure Files, share snapshots are read-only point-in-time copies and share soft delete keeps a deleted share.
Contoso Media needs a photo account that is locked down on day one, ages old files into cheaper tiers, uses its own encryption key, survives a zone failure and keeps a copy in another region. Build it one decision at a time.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
Compliance wants your own encryption key and no anonymous access, from day one.
😊 THE SOLUTION
Create the account with secure settings and switch to a customer-managed key.
- Containers made public by mistake✓ Anonymous access off
- Need control of the key✓ Customer-managed key
- Want a second layer✓ Infrastructure encryption
Start with a question
Who should hold the key to your bank locker: you or the bank?
Every locker in the bank vault is locked, whatever you do. The question is who keeps the key. For most people, letting the bank manage it is fine. Some customers want their own key so that, if they choose, nobody can open the locker, not even the bank.
Azure Storage works the same way. Your data is always encrypted. You decide whether Microsoft manages the key or you bring a customer-managed key.
Explain it like I’m 10
The technical explanation
Create the account: the decisions that matter
Portal: Storage accounts > + Create. The wizard tabs are Basics, Advanced, Networking, Data protection, Encryption, Tags, Review + create.
| Tab | Setting | Notes |
|---|---|---|
| Basics | Storage account name | Globally unique, 3 to 24 lowercase letters and numbers. Becomes https://<name>.blob.core.windows.net. |
| Basics | Performance | Standard (general-purpose v2, HDD-backed) or Premium (SSD) with an account type of block blobs, file shares or page blobs. Can’t be changed later. |
| Basics | Redundancy | LRS, ZRS, GRS, GZRS (and read-access versions). Can be changed later. |
| Advanced | Require secure transfer | HTTPS only for REST calls. Keep it on. |
| Advanced | Allow enabling anonymous access on individual containers | Off by default. Leave it off unless you publish public content. |
| Advanced | Enable storage account key access | Turn off once everything uses Microsoft Entra ID. |
| Advanced | Minimum TLS version | 1.2. |
| Advanced | Hierarchical namespace | Turns the account into Data Lake Storage Gen2. Some features, such as blob versioning, don’t support it. |
| Advanced | Access tier | Default tier for blobs: Hot, Cool or Cold. |
| Networking | Public network access | All networks, selected networks or disabled with private endpoints. |
| Data protection | Soft delete and versioning | The portal turns soft delete on by default; the CLI doesn’t. |
| Encryption | Key type, CMK support, infrastructure encryption | Covered below. |
Encryption at rest
All data in Azure Storage (blobs, files, queues, tables, disks) is encrypted with 256-bit AES before it’s stored. There’s nothing to enable and no extra cost.
- Microsoft-managed keys (MMK): the default. Microsoft rotates and protects the keys.
- Customer-managed keys (CMK): you keep an RSA key in Azure Key Vault or Managed HSM. Storage uses it to wrap the account’s data encryption key. Requirements: the vault has soft delete and purge protection, and the account has a system-assigned or user-assigned managed identity with Key Vault Crypto Service Encryption User on the key. Leave the key version empty and storage picks up new versions automatically.
- Infrastructure encryption: a second AES-256 layer with a different key. Create time only.
- Encryption scopes: named key settings that can apply a different key to a container or even a single blob.
- Customer-provided keys: a client sends its own key with each Blob Storage request. Rare, but it exists.
At create time you also choose whether CMK support covers blobs and files only or all service types (tables and queues too); that can’t change later.
If you disable the CMK or remove the identity’s access, storage can’t decrypt, so requests fail until you restore access. That’s the control customers want, and also the reason purge protection is mandatory.
CLI and PowerShell
# A secure general-purpose v2 account with double encryption
az storage account create -g rg-storage-prod -n stcontosoprod -l eastus \
--sku Standard_GZRS --kind StorageV2 --min-tls-version TLS1_2 \
--allow-blob-public-access false --https-only true --require-infrastructure-encryption
# Switch to a customer-managed key
az keyvault create -g rg-storage-prod -n kv-contoso-cmk --enable-purge-protection true
az storage account update -g rg-storage-prod -n stcontosoprod --assign-identity
# (give the identity "Key Vault Crypto Service Encryption User" on the key, then:)
az storage account update -g rg-storage-prod -n stcontosoprod \
--encryption-key-source Microsoft.Keyvault \
--encryption-key-vault https://kv-contoso-cmk.vault.azure.net \
--encryption-key-name cmk-storage
New-AzStorageAccount -ResourceGroupName rg-storage-prod -Name stcontosoprod -Location eastus `
-SkuName Standard_GZRS -Kind StorageV2 -MinimumTlsVersion TLS1_2 `
-AllowBlobPublicAccess $false -RequireInfrastructureEncryption
Set-AzStorageAccount -ResourceGroupName rg-storage-prod -Name stcontosoprod `
-KeyvaultEncryption -KeyVaultUri https://kv-contoso-cmk.vault.azure.net -KeyName cmk-storage
Architect level Upgrading old accounts
Older general-purpose v1 and BlobStorage accounts can be upgraded to general-purpose v2 in place (Configuration > Upgrade), which is a one-way change and can change your bill because of tier pricing. Premium accounts can’t become Standard and the reverse is also true: you create a new account and copy the data with AzCopy or object replication.
Real-world business scenario
Woodgrove Bank (fictional)
- The problem
- Regulators required that the bank, not its cloud provider, could make customer statements unreadable on demand, with double encryption for new data.
- What they used
- New general-purpose v2 accounts created with infrastructure encryption, TLS 1.2, no anonymous access and no key access, then moved to a customer-managed key in a Key Vault with purge protection, reached through a user-assigned managed identity.
- Why that choice
- The bank owns the key, can disable it in an emergency, and gets two independent layers of AES-256.
- The result
- The audit passed, and key rotation is a new key version in Key Vault that storage picks up by itself.
When to use it and when not to
✓ Use it when…
- You are creating a new account and want secure defaults from day one.
- Policy says your organization must own and be able to revoke the encryption key (CMK).
- You need different keys for different customers inside one account (encryption scopes).
✕ Think twice when…
- Microsoft-managed keys already meet your compliance needs; CMK adds work and a dependency on Key Vault.
- You expect to switch Standard to Premium later (create a new account instead).
- You plan to turn on infrastructure encryption for an existing account (not possible).
↔ Alternatives to consider
- Managed HSM for FIPS 140-3 Level 3 key protection.
- Encryption scopes for per-container keys.
Test yourself with exercises
5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner Is data in Azure Storage encrypted if I do nothing?
Model answer
Yes. Every byte written to Azure Storage is encrypted with 256-bit AES before it hits disk, and decrypted when you read it. You can't turn that off. What you can choose is who manages the key: Microsoft by default, or you with a customer-managed key in Key Vault.
Intermediate Which storage account settings can't you change after creation?
Model answer
The name, the performance tier (Standard or Premium) and the premium account type, infrastructure encryption, and whether customer-managed keys can cover tables and queues. Redundancy, access tier, TLS version, network rules and the key source can all be changed later.
Experienced developer What do you need before switching a storage account to a customer-managed key?
Model answer
A key vault or Managed HSM with soft delete and purge protection, an RSA or RSA-HSM key, and an identity for the storage account, system-assigned or user-assigned, with the Key Vault Crypto Service Encryption User role on the key (or get, wrapKey and unwrapKey in an access policy vault). If I leave the key version out, storage picks up new key versions automatically.
Scenario Compliance says the company must be able to make storage data unreadable on demand. What would you set up?
Model answer
A customer-managed key in Key Vault. If the key is disabled or access is removed, storage can't unwrap the data encryption keys, so reads and writes fail until access is restored. I'd add infrastructure encryption on new accounts if they also want double encryption, and protect the vault with purge protection so nobody can destroy the key by accident.
Quick revision
Key points
- Name is global, 3-24 lowercase letters and numbers; it becomes part of the endpoint URL.
- Standard GPv2 for most work; Premium block blob, file share or page blob for low latency.
- Keep secure transfer on, TLS 1.2 minimum, anonymous access off.
- All data is AES-256 encrypted at rest. Keys are Microsoft-managed or customer-managed.
- CMK needs a vault with soft delete and purge protection, and a managed identity with access.
- Infrastructure encryption is create-time only.
Important terminology
- General-purpose v2 (StorageV2)
- The standard storage account type for blobs, files, queues and tables, recommended for most scenarios.
- Premium storage account
- An SSD-backed account type for one service - block blobs, file shares or page blobs - with low latency.
- Storage service encryption
- Automatic AES-256 encryption of all data written to Azure Storage. It can't be turned off.
- Customer-managed key (CMK)
- An encryption key you own in Azure Key Vault or Managed HSM that protects the account's data encryption keys.
- Infrastructure encryption
- A second layer of AES-256 encryption at the infrastructure level, chosen only when the account is created.
- Encryption scope
- A named key setting inside an account that can apply a different key to a container or blob.
Common mistakes
- Trying to switch an existing account from Standard to Premium.
- Pointing CMK at a vault without purge protection.
- Forgetting to give the account an identity before choosing CMK.
Exam tips
- "Second layer of encryption" = infrastructure encryption (new account).
- "Company must control and revoke the key" = customer-managed key in Key Vault.
- "Different key per container" = encryption scope.
Five quick revision questions
-
1.Which algorithm does Azure Storage use to encrypt data at rest?Show
256-bit AES.
-
2.Can infrastructure encryption be enabled on an existing account?Show
No, only when you create it.
-
3.Which role should the account's identity have on a CMK?Show
Key Vault Crypto Service Encryption User.
-
4.What vault settings are required for CMK?Show
Soft delete and purge protection.
-
5.Which account type is recommended for most scenarios?Show
Standard general-purpose v2.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Storage Redundancy and Object Replication
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.