Comparing Azure Blob Storage, Queue Storage, Service Bus, Event Grid and Event Hubs by purpose, delivery guarantee, ordering, message size and retention, with a decision guide for .NET teams.
They solve different problems:
All of them deliver at least once, so consumers must deduplicate. The trade-off is features versus cost and throughput: Service Bus gives the richest guarantees, Event Hubs the highest throughput, Queue Storage the lowest price.
"I start with the intent of the data. If it's a file, it goes in Blob Storage, and if I need to tell someone about it, I send a small message or event that points to the blob, because brokers have size limits. If it's a message, meaning someone must act on it, like 'charge this order', I use Service Bus. It gives me peek-lock delivery, dead-letter queues, sessions for ordering per key, scheduled messages, duplicate detection and transactions. Queue Storage is the budget option for simple background work where I don't need any of that: 64 KiB messages, a visibility timeout and a dequeue count, and that's it.
If it's an event, meaning 'something happened, react if you care', I use Event Grid. It pushes events to webhooks, Functions, Service Bus or Event Hubs, filters by type or subject, and retries with back-off for up to 24 hours before dead-lettering to a blob. Many Azure services publish to it natively, such as Blob Storage raising
BlobCreated. If it's a stream, like telemetry from thousands of devices or clickstream data, I use Event Hubs. Events go into partitions, are kept for a retention period, and each consumer group reads at its own offset and checkpoints. It also exposes a Kafka endpoint, so Kafka clients work unchanged.Whatever I pick, delivery is at-least-once, so the consumer deduplicates on a message id or business key. The mistake I see is using Event Hubs as a job queue or Service Bus as a telemetry firehose. Choose by intent first, then check limits and price."
| Queue Storage | Service Bus | Event Grid | Event Hubs | |
|---|---|---|---|---|
| Model | Queue | Queues and topics (pull) | Push routing (also pull on namespace topics) | Partitioned log (pull) |
| Delivery | At-least-once | At-least-once (peek-lock) or at-most-once (receive-and-delete) | At-least-once, retries up to 24 h | At-least-once from last checkpoint |
| Ordering | None | FIFO per session | None | Per partition |
| Max message | 64 KiB | 256 KB Standard, up to 100 MB Premium | 1 MB | 1 MB |
| Retention | Up to TTL (default 7 days, can be unlimited) | Until consumed or TTL | Until delivered or dead-lettered | Time-based: up to 7 days Standard, 90 days Premium/Dedicated |
| Dead-lettering | No (Functions moves to -poison queue) |
Built-in DLQ | To a blob container | No; consumer handles it |
| Best for | Simple background jobs | Commands, workflows, business events | Reacting to state changes | Telemetry, logs, high-volume streams |
| Service | Why duplicates happen | Consumer strategy |
|---|---|---|
| Queue Storage | Visibility timeout expires before delete | Idempotent handler, track processed ids |
| Service Bus | Lock expires or handler crashes before Complete | Dedupe on MessageId in the same DB transaction (inbox) |
| Event Grid | Subscriber didn't return 2xx in time | Dedupe on event id |
| Event Hubs | Restart replays from last checkpoint | Idempotent writes (upsert by key) |
A logistics platform used Blob Storage for proof-of-delivery photos, Event Grid BlobCreated events to trigger thumbnail generation, Service Bus topics for order commands between services, and Event Hubs for GPS pings from [4,000] trucks every 10 seconds, about 400 events per second. Putting the GPS stream on Service Bus had earlier cost roughly three times as much and hit throttling at peak.
Checks that the candidate can choose a messaging or storage service by intent and knows the key limits and guarantees.
Green flags
Red flags
Message (command): OrderService ── "ChargeOrder 123" ──▶ [queue] ──▶ PaymentService (must act)
Event (fact): Storage ── "BlobCreated x.pdf" ──▶ Event Grid ──▶ 0..n subscribers (may react)
Stream (series): Devices ── readings ──▶ Event Hubs [p0][p1][p2]... ──▶ consumer groups read at own offsets
A message carries an expectation that a specific consumer acts; losing it is a business problem. An event reports a fact; the publisher does not care who listens. A stream is a sequence where the value is often in aggregate and replay.
Peek-lock: the broker locks the message for the lock duration (default 60 seconds, maximum 5 minutes), the consumer processes it and calls Complete. If the consumer crashes or the lock expires, the message becomes visible again and DeliveryCount goes up. After MaxDeliveryCount (default 10) it moves to the dead-letter queue. Sessions lock all messages with the same SessionId to one consumer, which gives FIFO per key. Duplicate detection drops messages with a repeated MessageId inside a configured window, which protects against publisher retries but not consumer redelivery.
Event Grid pushes an HTTP POST to each subscription. A 2xx response is success. Otherwise it retries with exponential back-off for up to 24 hours or 30 attempts (both configurable lower), then dead-letters to a blob container if configured. Webhook endpoints must pass a validation handshake. Events use the Event Grid schema or CloudEvents 1.0.
Producer ── partition key "truck-17" ──▶ hash ──▶ partition 3 ── offset 1,204,551
Consumer group "analytics": EventProcessorClient owns partition 3, checkpoints offset to Blob Storage
Events are appended to partitions and kept for the retention period whether read or not. EventProcessorClient balances partitions across instances and stores checkpoints in Blob Storage. After a restart, it resumes from the last checkpoint, so events after it are delivered again. Throughput is bought in throughput units (Standard) or processing units (Premium).
ReceiveMessages hides a message for the visibility timeout and returns a pop receipt. DeleteMessage with that receipt removes it. If the timeout passes first, it reappears with a higher dequeue count. There is no broker-side dead-lettering; the Functions Queue trigger moves a message to <queue>-poison after 5 dequeues. A single queue targets about 2,000 messages per second.
DeliveryCount and the DLQ in Service Bus Explorer.EventProcessorClient instances and watch partition ownership move.A blob upload raises an Event Grid event; the API sends a Service Bus command that references the blob instead of carrying the file. All clients use managed identity.
namespace Documents.Api;
using Azure.Identity;
using Azure.Messaging.ServiceBus;
using Azure.Storage.Blobs;
using Microsoft.Extensions.Azure;
public sealed record ProcessDocument(Guid DocumentId, string BlobName);
public static class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAzureClients(c =>
{
c.AddBlobServiceClient(new Uri(builder.Configuration["Storage:BlobUri"]!));
c.AddServiceBusClientWithNamespace(builder.Configuration["ServiceBus:Namespace"]!);
c.UseCredential(new DefaultAzureCredential());
});
builder.Services.AddSingleton(sp =>
sp.GetRequiredService<ServiceBusClient>().CreateSender("process-document"));
var app = builder.Build();
app.MapPost("/documents", async (IFormFile file, BlobServiceClient blobs,
ServiceBusSender sender, CancellationToken ct) =>
{
var id = Guid.NewGuid();
var blobName = $"{id}/{file.FileName}";
// 1. The file goes to Blob Storage: brokers have small size limits.
await blobs.GetBlobContainerClient("incoming")
.UploadBlobAsync(blobName, file.OpenReadStream(), ct);
// 2. A small command points to it. MessageId = document id, so Service Bus
// duplicate detection drops a retried send, and the consumer can dedupe on it.
var message = new ServiceBusMessage(BinaryData.FromObjectAsJson(new ProcessDocument(id, blobName)))
{
MessageId = id.ToString(),
ContentType = "application/json"
};
await sender.SendMessageAsync(message, ct);
return Results.Accepted($"/documents/{id}");
}).DisableAntiforgery();
app.Run();
}
}
MessageId inside the configured detection window (up to 7 days); redelivery after a lock timeout still happens. Instead: Make the consumer idempotent.Most real systems use several of these together: Blob for payloads, Event Grid to react to Azure resource events, Service Bus for the business workflow, Event Hubs for telemetry. The design skill is drawing clear lines so each one does what it is good at, and making every consumer idempotent because none of them is exactly-once.
Cost shapes the choice too. Queue Storage, Service Bus Standard and Event Grid bill per operation, so they are cheap at low volume but grow linearly. Service Bus Premium bills per messaging unit (dedicated capacity, VNet and private endpoints, large messages, predictable latency) and is what regulated production systems usually need. Event Hubs bills per throughput or processing unit, which makes millions of small events cheap where Service Bus would be expensive.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Queue Storage | Simple background jobs, tight budget | Very low, per operation | Need DLQ, ordering, topics |
| Service Bus Standard | Commands and events at moderate volume | Per operation | Private endpoints, large messages, strict latency |
| Service Bus Premium | Regulated production messaging | Per messaging unit (fixed) | Low-volume dev and test |
| Event Grid | Reacting to resource and domain events | Per million operations | Work that must not be lost without dead-lettering |
| Event Hubs | Telemetry, logs, analytics streams | Throughput or processing units | Per-message acknowledgement and retries |
| Service | Health signals | Alert on |
|---|---|---|
| Queue Storage | Queue length, message age, -poison queue count |
Oldest message age above SLA |
| Service Bus | Active, dead-lettered and scheduled message counts, server errors, throttled requests | DLQ growth, active count trend, throttling |
| Event Grid | Delivery attempts, failed and dead-lettered events, delivery latency | Any dead-lettered events, failure rate |
| Event Hubs | Incoming vs outgoing messages, consumer lag per partition, throttled requests | Lag above N minutes, throttling |
| All | End-to-end latency from distributed traces in Application Insights, cost per million messages in Cost Management | SLO breaches, cost anomalies |
Service Bus, RabbitMQ and SQS are queue brokers: a message is delivered, settled and gone. Kafka is a partitioned, retained log: messages stay for the retention period and each consumer group tracks an offset, so you can replay.
For a .NET system on Azure doing commands and business events, I default to Service Bus. I pick Kafka when I need high-volume streaming and replay. The trade-off is features and simplicity versus throughput and history.
Global ordering means one consumer processing one message at a time, which kills throughput, so real systems guarantee order per key: per order, customer or account.
SessionId; a ServiceBusSessionProcessor locks a session to one receiver and processes it in order, while different sessions run in parallel.MessageGroupId works like a session.Order breaks with competing consumers, retries, dead-lettering and rebalances. Better still, design so order doesn't matter: version numbers with "ignore older", events that carry full state, or commutative updates. The trade-off is that per-key order lets one stuck message block every later message for that key.
First I work out which problem I have:
To tell them apart I use Service Bus metrics (incoming, completed, abandoned, dead-lettered), the DLQ's DeadLetterReason and DeadLetterErrorDescription, DeliveryCount, and traces grouped by exception.
Poison messages loop when handlers catch and abandon forever, re-publish failures as new messages, or MaxDeliveryCount is huge. The fix: dead-letter permanent failures immediately, fix the handler or data, then resubmit from the DLQ in batches to an idempotent consumer. Scale consumers only up to the downstream's limit. To prevent it: alerts on oldest message age and DLQ count, plus a poison-message test. The trade-off: dead-lettering early keeps the queue flowing, but someone must own the DLQ.
Last updated 23 Nov 2026.