Azure Storage
An Azure Storage account is one resource that offers four storage services: Blob, Files, Queue and Table.
On this page · 5 min · Intermediate
On this page
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Intermediate
- Updated
- Oct 29, 2026
Related tutorials
Learning objectives#
- Name the four storage services
- Choose a redundancy option
- Create a secure storage account
- Prefer identity-based access over keys
Explanation#
Blob storage holds files of any kind (images, backups, videos). Azure Files offers SMB/NFS file shares. Queue storage holds simple messages. Table storage is a key–value NoSQL store.
Redundancy: LRS (three copies in one data centre), ZRS (three zones), GRS (plus a copy in the paired region) and GZRS (zones plus a paired region).
Every account has access keys that grant full control. Treat them like root passwords — better still, disable shared-key access and use Microsoft Entra ID with role assignments.
Code example: A secure storage account#
az storage account create -n stshop12345 -g rg-shop-dev -l centralindia \
--sku Standard_ZRS --kind StorageV2 \
--min-tls-version TLS1_2 --allow-blob-public-access false
# Give the signed-in user data access through Entra ID (no keys)
az role assignment create --assignee $(az ad signed-in-user show --query id -o tsv) \
--role "Storage Blob Data Contributor" \
--scope $(az storage account show -n stshop12345 -g rg-shop-dev --query id -o tsv)
"provisioningState": "Succeeded" — the account is created with zone redundancy, TLS 1.2 and public blob access disabled.
This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.
Step-by-step explanation#
- StorageV2 is the general-purpose account type.
- ZRS protects against a zone failure.
- Public blob access is disabled so nothing becomes public by accident.
- The role assignment grants data access via your identity instead of account keys.
Real-world use case#
A shop stores product images in Blob, sends “order placed” messages through Queue storage, and shares reports via Azure Files.
Common mistakes#
Anyone with the key controls the whole account. Use managed identity or rotate keys immediately if leaked.
Serve public files through a CDN or short-lived SAS instead.
Best practices#
- Disable public blob access by default
- Use Entra ID and RBAC for data access
- Choose redundancy based on recovery needs
- Enable soft delete for blobs and containers
Remember this#
One account, four services: Blob, Files, Queue, Table.
LRS < ZRS < GRS < GZRS (more copies, more protection).
Account key = master key. Avoid using it.
Practice exercise#
Your task: Enable 7-day soft delete for blobs on stshop12345.
Show solution
az storage account blob-service-properties update -n stshop12345 -g rg-shop-dev --enable-delete-retention true --delete-retention-days 7
Mini quiz#
Which service stores unstructured files such as images?
Want more? Practise all Microsoft Azure MCQs · Microsoft Azure interview questions
My notes#
Saved in this browser.