Last updated: May 2026
Azure Storage Intermediate AZ-104 ⏱ 12 min read

Azure Queue Storage

Azure Queue Storage is a simple, highly scalable message queuing service that enables communication between application components. Instead of one component calling another directly — which creates tight coupling and breaks when either component is down — queues let components leave messages for each other and process them asynchronously. It's the glue that holds loosely-coupled, resilient applications together.

What you'll learn What message queues are and why they matter · How Azure Queue Storage works · Queue concepts — messages, TTL, visibility timeout · Sending and receiving messages via CLI · Poison messages · Queue Storage vs Service Bus · Real-world use cases

What Are Message Queues?

Without a queue, if Component A needs to call Component B, it calls it directly. Problems with this:

  • If B is down, A fails too
  • If B is slow, A waits and slows down
  • If traffic spikes, both A and B get overwhelmed

With a queue in between, A drops a message into the queue and continues. B reads from the queue at its own pace. A and B are now decoupled — B can be down, slow, or restarting without affecting A at all.

ℹ️
Real-World Analogy A queue is like a restaurant order system. Waiters (producers) write orders and put them on a spike (the queue). Chefs (consumers) pick up orders one at a time and cook them. The waiter doesn't wait for the food — they go take more orders. If the kitchen is busy, orders queue up. The restaurant still functions smoothly.

How Azure Queue Storage Works

  1. A producer (your application) sends a message to the queue
  2. The message sits in the queue until a consumer picks it up
  3. A consumer reads the message — it becomes invisible to other consumers for a configurable visibility timeout
  4. If the consumer processes it successfully, it deletes the message from the queue
  5. If the consumer crashes before deleting, the message becomes visible again after the visibility timeout — another consumer can pick it up

Key Concepts

Message Size

Each message can be up to 64 KB in size. For larger payloads, store the data in Blob Storage and put a reference (URL) in the queue message.

Message TTL (Time to Live)

How long a message stays in the queue before being automatically deleted. Default is 7 days. Maximum is 7 days. Minimum is 1 second. Set to -1 for messages that never expire.

Visibility Timeout

When a consumer reads a message, it becomes invisible to other consumers for this duration. Default is 30 seconds. The consumer must delete the message within this time or it reappears in the queue. Set it based on how long your processing takes.

Queue Depth

Azure Queue Storage can hold up to 500 TB of messages per queue. Essentially unlimited for practical purposes.

Dequeue Count

Each message tracks how many times it has been dequeued. If a message keeps failing, its dequeue count grows. You can use this to detect poison messages (messages that always fail processing).

ConceptDefaultMaximum
Message size64 KB
Message TTL7 days7 days
Visibility timeout30 seconds7 days
Messages per batch read132
Queue capacity500 TB

Working With Queues via CLI

Azure CLI Create a queue and send/receive messages
# Create a queue
az storage queue create \
  --name myqueue \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Send a message
az storage message put \
  --queue-name myqueue \
  --content "Process order #12345" \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Receive (peek) a message without removing it
az storage message peek \
  --queue-name myqueue \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Get a message (makes it invisible for processing)
az storage message get \
  --queue-name myqueue \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Delete a message after processing (requires message ID and pop receipt)
az storage message delete \
  --queue-name myqueue \
  --id [message-id] \
  --pop-receipt [pop-receipt] \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Get queue length
az storage queue metadata show \
  --name myqueue \
  --account-name mystorageaccount2026 \
  --auth-mode login

Poison Messages

A poison message is a message that cannot be successfully processed — it keeps failing, reappearing in the queue, and failing again. Without handling, it can block processing indefinitely.

Detecting Poison Messages

Check the dequeue count. If a message has been dequeued more than a threshold (e.g., 5 times), it's likely a poison message.

Handling Poison Messages

  1. Read the message and check its dequeue count
  2. If dequeue count exceeds threshold, move it to a dead-letter queue (a separate queue for failed messages)
  3. Delete it from the main queue
  4. Alert your team to investigate the dead-letter queue
💡
Azure Functions Integration Azure Functions has a built-in Queue trigger that automatically handles poison messages — after 5 failed attempts, it moves the message to a -poison queue automatically. This is the easiest way to work with queues in production.

Queue Storage vs Service Bus

Azure has two queuing services. Choose the right one:

FeatureQueue StorageService Bus
Message size64 KBUp to 100 MB
Max TTL7 daysUnlimited
Ordering guaranteeNo (best effort)Yes (FIFO sessions)
Dead-letter queueManualBuilt-in
Topics/SubscriptionsNoYes (pub/sub)
CostVery cheapMore expensive
Best forSimple decoupling, high volumeEnterprise messaging, complex routing
💡
Simple Rule Need simple, cheap, high-volume queuing? → Queue Storage. Need message ordering, large messages, dead-letter queue, pub/sub topics, or enterprise features? → Service Bus.

Real-World Use Cases

Use CaseHow Queue Helps
E-commerce order processingWeb app puts order in queue; backend processes asynchronously
Image/video processingUpload triggers a queue message; worker VM processes the file
Email/notification sendingApp puts notification in queue; email service consumes at its own rate
Log ingestionMultiple services write logs to queue; single processor writes to storage
Task schedulingScheduled jobs place tasks in queue; workers pick up and execute
💡
AZ-104 Exam Tip Know that Queue Storage messages are up to 64 KB, have a max TTL of 7 days, use visibility timeout for at-least-once delivery, and that dequeue count helps identify poison messages. Know the key differences between Queue Storage and Service Bus.
📝 Practice Questions
Click an option to check your answer. AZ-104 style questions.
Q1. What is the maximum message size in Azure Queue Storage?
A 1 MB
B 64 KB
C 256 KB
D 10 MB
Q2. What happens to a queue message if the consumer reads it but crashes before deleting it?
A The message is permanently deleted from the queue
B After the visibility timeout, the message reappears for another consumer to process
C The message is automatically moved to a dead-letter queue
D The message immediately becomes visible for all consumers
Q3. What is a poison message?
A A message that has expired and been automatically deleted
B A message that consistently fails processing and keeps reappearing in the queue
C A message containing malicious or invalid data that corrupts the database
D A message that exceeds the maximum size limit
Q4. When should you choose Azure Service Bus over Azure Queue Storage?
A When you need to handle very high message volumes cheaply
B When you need message ordering guarantees, pub/sub topics, or built-in dead-letter queues
C For simple decoupling between two application components
D When using Azure Functions triggers
Q5. What is the default and maximum TTL (Time to Live) for messages in Azure Queue Storage?
A Default 24 hours, maximum 30 days
B Default 7 days, maximum 7 days
C Default 1 day, maximum 30 days
D No default TTL — messages persist indefinitely
Comments
Disclaimer: RedKite Cloud is an independent educational resource and is not affiliated with, endorsed by, or officially connected to Microsoft Corporation. All product names, logos, and trademarks are property of their respective owners. Content is written independently for educational purposes only.