Choose Blob Storage, Azure Files or managed disks
Store data in the right service with suitable tier, redundancy, scoped access, versioning and lifecycle rules.
By Invicly Tech, , in Microsoft Azure Cloud Engineering. About 14 minutes to read.
In short
Azure offers three main ways to store files and bytes: Blob Storage for objects reached over HTTPS, Azure Files for shared folders mounted over SMB or NFS, and managed disks for block storage attached to one VM. Each storage account also needs a redundancy choice and, for blobs, an access tier that trades storage price against read cost. Scoped access, versioning, soft delete and lifecycle rules keep the data safe and the bill under control.
Think of it like this: Blob Storage is a warehouse of labelled boxes, Azure Files is a shared office cabinet, and a managed disk is the drawer of one desk.
Explained simply
Most apps need to keep files somewhere: photos people upload, reports, backups or a database's data. Azure gives you three main places. Blob Storage holds files as objects that you read and write over HTTPS, a bit like a huge online drive with an API. Azure Files gives you a shared network folder that many servers can mount at once. A managed disk is a virtual hard drive attached to one VM.
Blob Storage and Azure Files live inside a storage account. When you create one, you choose redundancy, which means how many copies Azure keeps and where. LRS keeps three copies in one data centre. ZRS spreads them across three availability zones in a region. GRS and GZRS add a copy in a second region, for when a whole region has a disaster.
Blobs also have an access tier. Hot is for data you read often: storage costs more, reading costs less. Cool, Cold and Archive are cheaper to store and dearer to read, and Archive is offline until you bring the blob back, which can take hours. Lifecycle rules move blobs between tiers by age, so you do not have to.
Mistakes happen, so turn on protection early. Versioning keeps the old copy whenever a blob is overwritten. Soft delete keeps deleted blobs and containers for a number of days you choose. And instead of handing out the account key, give each app or person a role on just the container they need.
Cost note: storage is cheap for small labs, but it is not free outside the free account allowance. For a no-cost option, run Azurite, Microsoft's local storage emulator, and point the Azure CLI or SDK at it.
Press Play on a diagram to walk through it one step at a time.
- Objects in containers, over HTTPS
- Images, uploads, backups, logs
- Many readers at internet scale
- Access tiers: Hot, Cool, Cold, Archive
- Shared file system over SMB or NFS
- Lift-and-shift apps that expect a folder
- Mounted by many VMs or containers
- Snapshots and soft delete for shares
- Block device for one VM at a time
- OS and database volumes
- Lowest latency, set by disk type
- Snapshots and Azure Backup
- One region
- LRS: 3 copies in one data centre
- ZRS: copies across 3 availability zones
- Two regions
- GRS: LRS plus async copy to the paired region
- GZRS: ZRS plus async copy to the paired region
- Read access in the second region
- RA-GRS
- RA-GZRS
- 1Access control
Entra data roles, no shared keys, no public access.
- 2Soft delete
Deleted blobs and containers kept for N days.
- 3Versioning
Previous versions kept on every overwrite.
- 4Point-in-time restore
Roll block blobs back to a moment in time.
- 5Redundancy
Copies across zones or regions for hardware and site loss.
In depth
Access tiers and what they really cost
Each tier trades storage price against access price. Hot has the highest storage price and the lowest read and write charges. Cool suits data kept at least 30 days and read occasionally. Cold suits data kept at least 90 days and read rarely. Archive is the cheapest to store, needs at least 180 days, and is offline: you must rehydrate a blob to Hot, Cool or Cold before reading it. Standard priority rehydration can take up to 15 hours; high priority is faster and dearer.
The minimum periods matter because removing or moving a blob early triggers an early deletion charge for the remaining days. So a temporary file that lives two days belongs in Hot, even though Cool looks cheaper per GB. Set the default tier on the account, usually Hot, and let lifecycle rules move older data down.
- 1Day 0: Hot
Written and read by dashboards.
- 2Day 30: Cool
Read occasionally for incidents.
- 3Day 90: Cold
Kept for audits, rarely read.
- 4Day 180: Archive
Offline; rehydrate before reading.
- 5Day 365: Delete
Retention period ends.
Choosing redundancy
Redundancy protects against hardware and site failures, not against people. LRS is the cheapest and survives disk and rack failures in one data centre. ZRS keeps copies in three zones, so a zone outage does not stop reads or writes; it is a good default for production in regions with zones. GRS and GZRS copy data asynchronously to the paired region. That copy may be a few minutes behind, and you normally cannot read it unless you choose RA-GRS or RA-GZRS, which add a read-only secondary endpoint.
If the primary region fails, you can start a customer-managed failover so the secondary becomes primary. Because replication is asynchronous, the latest writes may be lost. Not every option is available for every account type or region, and premium accounts support fewer of them, so check before you design around one.
- LRS: one data centre, lowest cost
- ZRS: survives a zone outage
- GRS or GZRS: survives a regional disaster
- RA- variants: read the secondary at any time
- Failover can lose the most recent writes
Scoped access without account keys
The account key is a master password for the whole account. Prefer Microsoft Entra ID. Assign data roles, such as Storage Blob Data Reader or Storage Blob Data Contributor, at the narrowest scope that works, often a single container. Note that Owner or Contributor on the account manages the resource but does not by itself grant reading blobs with Entra sign-in.
When an outside client needs short-term access, such as a browser uploading one file, issue a user delegation SAS. It is a signed URL with permissions and an expiry, signed with a key obtained through Entra ID rather than the account key, and it can last at most seven days. Once nothing depends on keys, set allowSharedKeyAccess to false so account keys and account SAS stop working entirely.
- Browser to API: Ask to upload photo.jpg1Ask to upload photo.jpg
- API to Microsoft Entra ID: Managed identity gets a storage token2Managed identity gets a storage token
- API to Blob Storage: Get user delegation key3Get user delegation key
- API to Browser: SAS URL: write only, 15 minutes4SAS URL: write only, 15 minutes
- Browser to Blob Storage: PUT photo.jpg using the SAS URL5PUT photo.jpg using the SAS URL
Versioning, soft delete and restore
Blob versioning automatically keeps the previous version whenever a blob is overwritten or deleted. Each version has a version ID, and you can read, copy back or delete it. Blob soft delete keeps deleted blobs and snapshots for 1 to 365 days; container soft delete does the same for whole containers. Together they cover the common accidents: overwrite, delete and dropped container.
For bigger mistakes, point-in-time restore can roll a set of block blobs back to an earlier time. It needs versioning, change feed and soft delete turned on, and the restore window must be shorter than the soft delete period. Azure Files has share snapshots and share soft delete, and managed disks have snapshots and Azure Backup. Remember that every version you keep is billed, so pair versioning with a lifecycle rule that deletes old versions.
- Versioning: recover from overwrites
- Blob soft delete: recover deleted blobs
- Container soft delete: recover deleted containers
- Point-in-time restore: roll back many block blobs
- Lifecycle rule to expire old versions
When Azure Files or a disk is the right answer
Choose Azure Files when software expects a normal file path and several machines must share it: a legacy app that writes to a network drive, shared configuration, or a lift-and-shift of a Windows file server. SMB shares work from Windows, Linux and macOS, and NFS shares are available on the premium (SSD) file tier for Linux clients. Azure File Sync can cache a share on an on-premises Windows server.
Choose a managed disk when one VM needs a fast block device, such as a self-managed database or a build server. Disk performance depends on the type and, for Premium SSD, on the size, so a bigger disk can be faster. Premium SSD v2 and Ultra Disk let you set IOPS and throughput directly. If an app can use HTTPS objects instead, Blob Storage usually scales further and costs less.
Learn it in 5 short steps
About 35m each. Track them with a timer in your plan.
- 1Compare Blob, Files and disks~35m
- 2Pick access tier and redundancy~35m
- 3Grant scoped access~35m
- 4Turn on versioning and soft delete~35m
- 5Write a lifecycle rule~35m
Key points
- Pick the service by how the app reads data: HTTP objects, a shared folder, or a disk for one VM.
- Hot, Cool, Cold and Archive tiers cost less to store and more to read; Cool, Cold and Archive have minimum storage periods.
- Grant apps a data role such as Storage Blob Data Reader on a container, and avoid sharing account keys.
- Versioning and soft delete let you recover overwritten or deleted blobs within the retention period.
- Lifecycle rules move or delete blobs by age automatically, so old data stops costing Hot-tier prices.
Key terms
Tap a card to flip it. 0/6 known
Examples
az storage account create -g rg-lab-data -n stcontosolab01 \
--sku Standard_ZRS --kind StorageV2 --access-tier Hot \
--allow-blob-public-access false --allow-shared-key-access false
az storage container create --account-name stcontosolab01 \
-n uploads --auth-mode login
az storage blob upload --account-name stcontosolab01 -c uploads \
-n hello.txt -f hello.txt --auth-mode loginA zone-redundant account that only accepts Entra ID sign-in; your user needs Storage Blob Data Contributor first.
Recover a blob someone overwrote
Prerequisites: the lab storage account and the Storage Blob Data Contributor role on it. Step 1: turn on versioning and 14-day soft delete. Step 2: upload report.csv, then upload a different file under the same name. Step 3: list versions; you should see two. Step 4: download the older version by its version ID and upload it again as the current blob. Evidence: the current content matches the original. Cleanup: delete the resource group, or for Azurite, stop the emulator.
SA=stcontosolab01; RG=rg-lab-data
az storage account blob-service-properties update -n $SA -g $RG \
--enable-versioning true --enable-delete-retention true --delete-retention-days 14 \
--enable-container-delete-retention true --container-delete-retention-days 14
az storage blob upload --account-name $SA -c uploads -n report.csv -f v1.csv --auth-mode login
az storage blob upload --account-name $SA -c uploads -n report.csv -f v2.csv --overwrite --auth-mode login
az storage blob list --account-name $SA -c uploads --include v --auth-mode login \
--query "[?name=='report.csv'].{v:versionId,current:isCurrentVersion}" -o table
az storage blob download --account-name $SA -c uploads -n report.csv \
--version-id <older-version-id> -f restored.csv --auth-mode login
az storage blob upload --account-name $SA -c uploads -n report.csv -f restored.csv --overwrite --auth-mode loginA lifecycle rule for logs and old versions
Goal: logs under uploads/logs/ move to Cool after 30 days, Archive after 180, and are deleted after 365; old versions are deleted after 90 days. Step 1: write the policy JSON. Note that prefixMatch starts with the container name. Step 2: apply it. Step 3: show it back. Evidence: the policy appears on the account. Rules run about once a day, so changes may take up to 24 hours or more to act. Rollback: delete the policy with az storage account management-policy delete.
{
"rules": [{
"name": "age-out-logs", "enabled": true, "type": "Lifecycle",
"definition": {
"filters": { "blobTypes": ["blockBlob"], "prefixMatch": ["uploads/logs/"] },
"actions": {
"baseBlob": {
"tierToCool": { "daysAfterModificationGreaterThan": 30 },
"tierToArchive": { "daysAfterModificationGreaterThan": 180 },
"delete": { "daysAfterModificationGreaterThan": 365 } },
"version": { "delete": { "daysAfterCreationGreaterThan": 90 } }
} } }]
}Quick reference
- Minimum storage periods: Cool 30 days, Cold 90 days, Archive 180 days
- Archive is offline; standard rehydration can take up to 15 hours
- ZRS for zone outages, GZRS for regional disasters, RA- to read the secondary
- Use --auth-mode login with the CLI to sign in with Entra ID instead of keys
- User delegation SAS: signed via Entra ID, maximum lifetime 7 days
- Lifecycle prefixMatch includes the container name, for example uploads/logs/
- Local emulator: Azurite, connection string UseDevelopmentStorage=true
Common mistakes
- Moving data to Archive and then needing it today. Rehydration can take up to 15 hours at standard priority.
- Handing out the account key. It grants full access to everything in the account and is hard to rotate safely.
- Assuming redundancy is a backup. A deletion or overwrite is copied to every replica; use versioning and soft delete.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
Show the redundancy, default access tier and shared key setting of your storage account.
- Exercise 2medium
Grant a managed identity read-only access to the uploads container only, then create a 15-minute read SAS for one blob without using the account key.
- Exercise 3hard
Design storage for the sample app: user uploads (read often for a month, then rarely, kept 2 years), nightly database dumps (kept 35 days) and a shared config folder for three VMs. Give service, redundancy, tier and protection for each.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- What is the difference between Blob Storage and Azure Files?
- Blob Storage stores objects you reach over HTTPS with an API or SDK. Azure Files gives a shared folder that operating systems mount over SMB or NFS, so existing apps can use normal file paths.
- Is geo-redundant storage a backup?
- No. It protects against losing a region, but deletes and overwrites are replicated too. Use versioning, soft delete or Azure Backup for that.
- Can I test Blob Storage without an Azure subscription?
- Yes. Azurite emulates Blob, Queue and Table storage locally, and the CLI and SDKs can connect to it with UseDevelopmentStorage=true.
- How long does it take to read a blob from Archive?
- You must rehydrate it first. Standard priority can take up to 15 hours; high priority is usually much faster for smaller blobs but costs more.