Compare
Azure Service Bus vs Event Grid
30-second answer
Use Service Bus for messages: commands or jobs a back end must process reliably, with peek-lock, sessions and dead-letter queues. Use Event Grid for events: small notices that something happened, pushed to handlers with filters and retries.
Simulate it »Side by side
↔ Swipe the table to see every column.
| Service Bus | Event Grid | |
|---|---|---|
| Carries | Messages (the data and the intent) | Events (a fact: “blob created”) |
| Delivery | Receivers pull (or a trigger listens) | Pushed to the handler |
| Ordering | FIFO with sessions | Not guaranteed |
| Failed processing | Abandon, retry, dead-letter queue | Retry up to 24 hours, then optional dead-letter |
| Fan-out | Topics and subscriptions | Many event subscriptions per topic |
| Typical AI use | Queue summarisation jobs | Start indexing when a file is uploaded |
Prices are illustrative pay-as-you-go list prices converted at approximate rates, for "price feel" only. Check the Azure pricing calculator for real quotes.
Which one should I pick?
Service Bus
Pick it when the work must not be lost and may take time, like processing an order or a PDF
Event Grid
Pick it when you want to react quickly to something that happened in Azure or in your app
Simulate it
🖱️ Drag to rotate · scroll or pinch to zoom
Topics and subscriptions
A topic is a queue with many readers. Each subscription gets its own copy of every message, and filters (SQL or correlation) decide which messages a subscription keeps. One "document uploaded" message can feed indexing, billing and audit.
🤔 What happens if…
Read this tour as text
- Don’t make users wait. Summarising a 40-page PDF takes a minute. If the web API does it inline, requests pile up and time out. Put a message on a queue instead, reply "accepted", and let a worker do the slow part.
- Service Bus queue: peek-lock. An Azure Service Bus queue hands each message to one receiver. In peek-lock mode the message is locked, not removed. The worker completes it when done, or abandons it so it can be tried again. If the worker crashes, the lock expires and the message comes back.
- Dead-letter queue. A poison message fails every time. After max delivery count attempts (10 by default) Service Bus moves it to the dead-letter queue (DLQ), a sub-queue you read, fix and resubmit. Expired messages can go there too.
- Topics and subscriptions. A topic is a queue with many readers. Each subscription gets its own copy of every message, and filters (SQL or correlation) decide which messages a subscription keeps. One "document uploaded" message can feed indexing, billing and audit.
- Event Grid: something happened. Azure Event Grid pushes events (small facts: "blob created") to handlers. You can publish custom events to a custom topic. Event subscriptions pick the handler, and filters (event type, subject begins/ends with, advanced) cut out the noise.
- Event Grid retries. If the handler is down, Event Grid retries with exponential backoff, by default up to 30 attempts within 24 hours (you can lower both). After that it drops the event, unless you configured dead-lettering to a storage container.
- Functions: triggers and bindings. An Azure Function runs when its trigger fires: HTTP, Service Bus, Event Grid, timer, Cosmos DB and more. Bindings connect inputs and outputs without client code: an HTTP-triggered API can write a message to a queue with an output binding.
- Functions scale with the work. On the Flex Consumption plan a function app adds instances as messages arrive and scales to zero when idle. Premium keeps warm instances to avoid cold starts. Settings live in app settings, and you deploy a zip package or a container.
Questions people ask
Can they work together?
Yes. Event Grid can deliver events into a Service Bus queue, so a worker processes them reliably at its own pace.
What about Event Hubs?
Event Hubs is for streaming millions of telemetry events per second. It is not in the AI-200 skills list, but it is a common distractor.