Blob, File, Queue and Table storage: which one to use
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Day-to-day operations
-
Phase 3: Enterprise architecture
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
Azure storage types are the four services that live inside every storage account: Blob, File, Queue and Table. They share one account and one bill, yet each one solves a very different problem.
Choosing the wrong one is a common design mistake, like putting log files in a file share, orders in a blob or app settings in a queue. It works for a week or so and then turns slow, expensive or fragile.
In the lab you’ll put real data into all four using the account from Lesson 21, then fix a queue message that won’t stop coming back and a share you can’t reach from home.
| Time | You need | Cost | By the end you can |
|---|---|---|---|
| About 45 minutes | The storage account from Lesson 21, the CLI | Under one US cent: a few small items in your existing account | Choose the right storage type for a job and work with each from the CLI |
What it is, in one line
Blobs store files as objects, Files gives you network shares, Queues carry messages between apps and Tables hold simple rows of data.
In Simple Words
A school office
Think of a school. The store room holds boxes of anything (old exam papers, photos, videos) and you find a box by its label, which is Blob storage. The shared cupboard in the staff room has folders any teacher can open, much like a drive on their computer, and that’s Azure Files. The in-tray on the clerk’s desk holds notes like “print 40 copies”, where the clerk picks one up, does it and throws the note away, so that’s a Queue, and the register with one row per student is a Table.
Engineer's View
The four services in detail
- Blob: objects over HTTPS. You use block blobs for files, backups and media, append blobs for logs that only ever grow, and page blobs for disks. The tiers are Hot, Cool, Cold and Archive (Lesson 23), and if you turn on hierarchical namespace it becomes Data Lake Storage Gen2.
- Files: SMB 3 shares (plus NFS 4.1 on premium) that Windows, Linux and macOS mount like a normal drive. SMB runs on TCP 445, and a share can go up to 100 TiB. It suits lift-and-shift apps and shared folders (Lesson 25).
- Queue: simple messages of up to 64 KB, kept for 7 days by default. When a reader gets a message it’s hidden for 30 seconds by default, and if the reader doesn’t delete it in that time it comes back with a higher dequeue count.
- Table: schemaless NoSQL rows (entities) that you find by PartitionKey and RowKey, each up to 1 MB. It’s cheap and quick for lookups by key, but there are no joins. If you need global scale, Azure Cosmos DB for Table speaks the same API.
Data roles are separate for each service: there are Storage Blob Data, Storage Queue Data and Storage Table Data roles. Azure Files works differently, with identity-based SMB access, and that’s covered in Lesson 25.
How it works, step by step
Keep this table handy for when someone asks “where should we put this?”:
| If the data is… | Use | Why |
|---|---|---|
| Files, images, backups, logs, exports | Blob | Cheapest per GB, reachable over HTTPS from anywhere, has tiers |
| A folder that apps or people open as a drive | Files | An SMB/NFS share with no app changes needed |
| A to-do list between two apps | Queue | Keeps sender and worker apart, and survives restarts |
| Small records looked up by a key | Table | Cheap key-value lookups |
| A VM’s operating system or database files | Managed disk | Block storage for one VM (Lesson 19) |
This is how a queue keeps two apps apart, one step at a time:
- The web app drops “order 1001” on the queue and carries on with its work.
- A worker picks up the message, and for 30 seconds it’s hidden from the other workers.
- The worker packs the order, then deletes the message using its pop receipt.
- If the worker crashes before that, the message shows up again and another worker takes it.
- A message that keeps failing (say, dequeue count 5) gets moved to a “poison” queue so a human can look at it.
One account serves all four services, each at its own address: .blob.core.windows.net, .file.core.windows.net, .queue.core.windows.net and .table.core.windows.net. Firewall rules and private endpoints (Lesson 26) are set separately for each service.
Blob and Files use different protocols. Blob runs over HTTPS on port 443, which gets through almost anywhere, but SMB to Azure Files needs port 445, and a lot of home and office networks block that.
Hands-on lab: all four Azure storage types
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Open PowerShell and load the storage account name you saved in Lesson 21:
$st = (Get-Content C:\azure-lab\storage.txt)
$id = az storage account show --resource-group rg-saat-data --name $st --query id -o tsv
$me = az ad signed-in-user show --query id -o tsv1Blob: add an append blob for a log
Run this:
Set-Content -Path C:\azure-lab\app.log -Value 'start'
az storage blob upload --account-name $st --auth-mode login --container-name lab --name app.log --file C:\azure-lab\app.log --type append -o none
az storage blob list --account-name $st --auth-mode login --container-name lab --query "[].{name:name, type:properties.blobType, bytes:properties.contentLength}" -o tableYou should see this:
Name Type Bytes
--------- ---------- -------
app.log AppendBlob 7
hello.txt BlockBlob 222Files: create a share and upload a file
Run this:
az storage share-rm create --resource-group rg-saat-data --storage-account $st --name share-lab --quota 5 -o none
az storage file upload --account-name $st --share-name share-lab --source C:\azure-lab\hello.txt -o none
az storage file list --account-name $st --share-name share-lab --query "[].name" -o tsvYou should see something like this:
WARNING:
There are no credentials provided in your command and environment, we will query for account key for your storage account.
It is recommended to provide --connection-string, --account-key or --sas-token in your command as credentials.
...
hello.txtshare-rm goes through Azure Resource Manager, so your Owner role covers it. The file commands fell back to the account key, as the warning says, and Lesson 25 switches you to identity-based access.
3Queue and Table: add the data roles
Run this and then wait two minutes:
foreach ($r in 'Storage Queue Data Contributor', 'Storage Table Data Contributor') {
az role assignment create --assignee $me --role $r --scope $id -o none
}
Start-Sleep -Seconds 1204Queue: send, peek, receive and delete
Run this:
az storage queue create --account-name $st --auth-mode login --name q-orders -o none
az storage message put --account-name $st --auth-mode login --queue-name q-orders --content 'order 1001' -o none
az storage message peek --account-name $st --auth-mode login --queue-name q-orders --query "[].{content:content, dequeueCount:dequeueCount}" -o table
$m = az storage message get --account-name $st --auth-mode login --queue-name q-orders | ConvertFrom-Json
az storage message delete --account-name $st --auth-mode login --queue-name q-orders --id $m.id --pop-receipt $m.popReceipt
az storage message peek --account-name $st --auth-mode login --queue-name q-orders -o tsvYou should see this:
Content DequeueCount
---------- --------------
order 1001 0Peek only looks at the message, get takes it and hides it, and delete removes it for good. The last peek prints nothing because the queue is now empty.
5Table: insert and query rows
Run this:
az storage table create --account-name $st --auth-mode login --name orders -o none
az storage entity insert --account-name $st --auth-mode login --table-name orders --entity PartitionKey=pune RowKey=1001 status=packed -o none
az storage entity insert --account-name $st --auth-mode login --table-name orders --entity PartitionKey=pune RowKey=1002 status=shipped -o none
az storage entity insert --account-name $st --auth-mode login --table-name orders --entity PartitionKey=delhi RowKey=2001 status=packed -o none
az storage entity query --account-name $st --auth-mode login --table-name orders --filter "PartitionKey eq 'pune'" -o tableYou should see this:
PartitionKey RowKey Status
-------------- -------- --------
pune 1001 packed
pune 1002 shippedA query on PartitionKey goes straight to one partition, so it’s quick. Filtering on status alone would scan every row, and that gets slow and expensive as the table grows, so design your keys around how you’ll look the data up.

✅ Checkpoint: Your account now holds an append blob, a share with hello.txt, an empty q-orders queue and an orders table with three rows.
Break It, Then Fix It
These two problems show up with queues and file shares on real projects.
1Break it: the message that keeps coming back
Put a message on the queue, take it, “crash” (don’t delete it), and look again after 40 seconds:
az storage message put --account-name $st --auth-mode login --queue-name q-orders --content 'order 1003' -o none
az storage message get --account-name $st --auth-mode login --queue-name q-orders --query "[].{content:content, dequeueCount:dequeueCount}" -o table
az storage message peek --account-name $st --auth-mode login --queue-name q-orders -o tsv
Start-Sleep -Seconds 40
az storage message get --account-name $st --auth-mode login --queue-name q-orders --query "[].{content:content, dequeueCount:dequeueCount}" -o tableYou should see something like this:
Content DequeueCount
---------- --------------
order 1003 1
Content DequeueCount
---------- --------------
order 1003 2The peek in the middle printed nothing, because the message was hidden, not gone. After 30 seconds it came back with dequeue count 2. In production, a worker that crashes or runs past the timeout ends up getting orders packed twice.
Fix it: delete the message once the work is done, and give slow jobs a longer timeout:
$m = az storage message get --account-name $st --auth-mode login --queue-name q-orders --visibility-timeout 300 | ConvertFrom-Json
# ... do the work ...
az storage message delete --account-name $st --auth-mode login --queue-name q-orders --id $m.id --pop-receipt $m.popReceipt
az storage message peek --account-name $st --auth-mode login --queue-name q-orders -o tsvNow the last peek prints nothing. Workers still need to cope with a duplicate safely (for example by checking whether order 1003 is already packed), because a message can still arrive twice.
2Break it: “I can’t map the share from home”
Test SMB from your laptop:
Test-NetConnection -ComputerName "$st.file.core.windows.net" -Port 445On a lot of home and office networks you’ll get something like this:
WARNING: TCP connect to (20.60.x.x : 445) failed
ComputerName : stsaat48213.file.core.windows.net
RemoteAddress : 20.60.x.x
RemotePort : 445
InterfaceAlias : Wi-Fi
SourceAddress : 192.168.1.20
TcpTestSucceeded : FalseMany internet providers and company firewalls block outbound port 445 because of old SMB worms, so net use fails with “The network path was not found” (error 53) even though the share is perfectly fine. If your test says True, your network lets it through.
Fix it: check that HTTPS works and use that for now, then mount from inside Azure or over a VPN:
Test-NetConnection -ComputerName "$st.file.core.windows.net" -Port 443 | Select-Object TcpTestSucceeded
az storage file download --account-name $st --share-name share-lab --path hello.txt --dest C:\azure-lab\hello-from-share.txt -o none
Get-Content C:\azure-lab\hello-from-share.txtYou should see this:
TcpTestSucceeded
----------------
True
hello from lesson 21The real fixes are a VPN or ExpressRoute into Azure, mounting from a VM inside Azure (Lesson 25 does this on win01), or Azure File Sync to a local server. Asking the provider to open 445 hardly ever works out.
To clean up, keep the account but remove this lesson’s items:
az storage queue delete --account-name $st --auth-mode login --name q-orders -o none
az storage table delete --account-name $st --auth-mode login --name orders -o none
az storage blob delete --account-name $st --auth-mode login --container-name lab --name app.log
az storage share-rm delete --resource-group rg-saat-data --storage-account $st --name share-lab --yes
✅ Checkpoint: You fixed a returning message and diagnosed a blocked port. The account keeps lab/hello.txt for Lesson 23.
This happened at work
The invoice that was emailed four times
A billing team moved its invoice emails onto a queue with a worker behind it, and for months it ran without trouble. Then customers started receiving the same invoice two, three, sometimes four times, and only ever at month-end.
It turned out that at month-end the PDF step was taking about 50 seconds per invoice. The worker used the default 30-second visibility timeout, so the message became visible again while the first worker was still busy with it, and a second worker picked it up and sent it a second time.
What they changed: the worker now asks for a 5-minute timeout and extends it when a job runs long. Before sending, it checks a Table entity keyed by invoice number and skips anything already sent, and messages with a dequeue count over 5 go to a poison queue that pages the on-call engineer.
Common mistakes and troubleshooting
| Mistake | What you see | What to do |
|---|---|---|
| Not deleting queue messages | Work repeats; dequeue count climbs | Delete it with the pop receipt once the work is done. |
| Timeout shorter than the job | Duplicates at busy times | Set a longer visibility timeout and make the workers idempotent. |
| Mapping Azure Files from home | Error 53, port 445 test fails | Use a VPN, a VM in Azure, or Azure File Sync. |
| Logs written to a file share | Locks, slow writes, high cost | Send them to append blobs or Log Analytics. |
| Table queries without PartitionKey | Slow, costly scans | Design the keys around how you look the data up. |
| Expecting Owner to cover queues and tables | AuthorizationPermissionMismatch | Assign the matching Queue or Table data role. |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. What are the four data services in an Azure storage account?
Why they ask this: It’s about the basic layout.
How you might answer: There’s Blob for objects and files over HTTPS, Files for SMB or NFS shares, Queue for messages between apps and Table for simple key-value rows.
2. What are the three blob types?
Why they ask this: They want more from you than “blobs store files”.
How you might answer: Block blobs cover most files, append blobs are for data that only grows, like logs, and page blobs handle random reads and writes, which is how disks are stored.
3. When would you use a queue?
Why they ask this: They want to know you understand decoupling.
How you might answer: Whenever one app has to hand work to another without waiting for it, say a web page placing an order and a worker processing it. If the worker is slow or down, the queue just holds the work.
2–5 years experience
4. A worker processes some queue messages twice. Why?
Why they ask this: It’s a very common issue in production.
How you might answer: Either the work ran longer than the visibility timeout or the worker crashed before deleting the message, so it became visible again. I’d raise the timeout, delete only after success, and make the worker idempotent so that a repeat doesn’t do any harm.
5. A user can’t map an Azure file share from home. How do you troubleshoot?
Why they ask this: They want a method rather than a guess.
How you might answer: I’d run Test-NetConnection to the file endpoint on 445. If that fails while 443 works, the network is blocking SMB. After that I’d check the storage firewall and credentials. Usually the answer is a VPN, a VM in Azure, or Azure File Sync.
6. How do you design PartitionKey and RowKey for Table storage?
Why they ask this: They want to see that you think about queries first.
How you might answer: I design them around the most common lookup. Rows that get queried together share a PartitionKey, and the RowKey makes each row unique inside it. I’d steer clear of one giant partition and of queries that skip the PartitionKey, since those scan the whole table.
Senior level
7. Storage queues or Service Bus: how do you choose?
Why they ask this: They want to hear the trade-offs.
How you might answer: Storage queues are simple and cheap, they hold millions of messages, and they’re fine for basic hand-offs of work. Service Bus adds ordering, sessions, dead-lettering, transactions and topics with subscribers, so if I need guaranteed order or publish-subscribe I’d pick Service Bus.
8. Table storage or Cosmos DB for Table?
Why they ask this: They’re checking how you think about scale and SLA.
How you might answer: Table storage is cheap and does fine for moderate key lookups in a single region. Cosmos DB for Table uses the same API but gives you global distribution, guaranteed low latency and automatic indexing on every property, and it costs more.
9. How would you secure access to all four services for different apps?
Why they ask this: They want least privilege for each service.
How you might answer: I’d give each app a managed identity with the narrowest data role it needs: Blob Data Reader on one container, Queue Data Message Sender for the producer and Processor for the worker, and Table Data Reader where it’s needed. I’d also turn shared key access off where I can and use private endpoints per service.
Quick quiz
Q1. Which service gives you an SMB share you can map as a drive?
- Blob
- Files
- Queue
- Table
Show answer
B — Azure Files serves SMB (and NFS) shares.
Q2. Which blob type suits a log that only grows?
- Block
- Append
- Page
- Archive
Show answer
B — Append blobs only add to the end.
Q3. What happens to a queue message that is received but not deleted?
- It is lost
- It reappears after the visibility timeout
- It moves to Archive
- It is copied to a table
Show answer
B — It comes back with a higher dequeue count.
Q4. Mapping a share from home fails; the port 445 test fails. Likely cause?
- Wrong redundancy
- The network blocks SMB
- Table not created
- Missing append blob
Show answer
B — Many networks block outbound 445.
Q5. Which keys find a Table entity?
- Id and Version
- PartitionKey and RowKey
- Name and Tier
- Queue and Receipt
Show answer
B — PartitionKey plus RowKey is the unique key.
Quick recap
You can now match a job to the right storage service and catch the classic mistakes.
- Blob for objects, Files for shares, Queue for work hand-offs, Table for key lookups.
- Delete queue messages after the work is done, and make workers safe to repeat.
- SMB needs port 445, so test that before you blame the share.
- Design your table keys around the queries you’ll run.
- Each service has its own data roles.
Next lesson
Lesson 23: Blob access tiers and lifecycle rules → Next you’ll move blobs between Hot, Cool, Cold and Archive and automate the moves with a lifecycle rule.
Further reading: Azure storage types
Want to go deeper into Azure storage types? See Microsoft’s Introduction to Azure Storage and Troubleshoot Azure Files SMB connectivity. You can also see the full plan for this course on the Azure Cloud Administration course page.
