Microsoft Azure Learning Journey

Service Bus, Event Grid, or Event Hubs? Design Event-Driven Azure Systems

Choose an Azure messaging service by the work the consumer must perform, the delivery contract, and the way events are retained.

5 min read · 818 words
Microsoft AzureCloud ArchitectureDistributed SystemsReliability EngineeringDevOps
Service Bus, Event Grid, or Event Hubs? Design Event-Driven Azure Systems cover image

“Send an event” can mean “notify interested systems,” “queue a command until a worker can process it,” or “retain a high-volume stream for several independent consumers.” Those are different contracts. Azure Service Bus, Event Grid, and Event Hubs overlap in some integrations but solve different problems; choosing by name or by an AWS analogy can leave a system with the wrong ordering, replay, or settlement behavior.

What you’ll learn

Prerequisites

Start with the contract

Before selecting a service, write down:

Compare the three services

Service Model Good fit Design boundary
Azure Service Bus Queues and topics with brokered message settlement Commands, work queues, competing consumers, and durable publish/subscribe workflows Messages are settled or retried; sessions and duplicate detection are configured features with tier and workload constraints
Azure Event Grid Event routing and publish/subscribe delivery Notify handlers that a resource or application event occurred; route to supported destinations Delivery is handled by subscriptions and retry/dead-letter configuration; it is not a retained, partitioned analytics stream
Azure Event Hubs Partitioned event stream with independent consumer groups High-volume telemetry, ordered partition processing, and stream replay within configured retention Ordering is per partition; consumers checkpoint their progress and should expect replay/duplicates

Use Service Bus for a business command that must remain available until a worker handles it. Use Event Grid when a producer should publish a notification to loosely coupled handlers. Use Event Hubs when consumers need to process a retained stream at their own pace. If one event needs all three behaviors, a topology can combine the services, but every hop adds cost, permissions, and operational work.

Delivery is not the same as exactly-once work

Most distributed message paths can redeliver after a timeout, network failure, or consumer restart. Even if a broker deduplicates messages under a supported configuration, the consumer can still repeat a database or external side effect. Give each event a stable ID, make the handler idempotent, and keep an inbox or processed-event record where the business invariant needs it.

Ordering has a scope. Event Hubs preserves order within a partition, not across the whole stream. Service Bus ordering features depend on sessions and the chosen entity configuration. Event Grid routing does not provide a global ordered log. If a business rule depends on order, define the key and concurrency boundary explicitly.

Dead-lettering is an investigation path, not a cleanup policy. Monitor queue age, delivery attempts, dead-letter growth, event lag, and handler failures. Define who owns replay and how replay avoids repeating irreversible effects.

Keep producers and consumers loosely coupled

Publish a stable event contract with version, event ID, producer, entity key, event time, and sensitivity classification. Consumers should subscribe only to the fields and event types they need. Do not expose secrets or raw personal data in a payload just because a message bus can carry it.

Azure Functions can scale event handlers for supported triggers; Logic Apps can orchestrate connectors and business workflows. Neither service removes the need to bound concurrency, understand retries, protect downstream dependencies, and configure a dead-letter or poison-message path.

Use Entra ID and scoped sender/receiver roles where supported. Separate data-plane send/receive permissions from resource administration. Add private connectivity when required, then verify DNS and runtime routes. A private endpoint is not authorization, and a role assignment does not make an unsafe event schema acceptable.

✅ Checkpoint: Describe one message as a command, notification, or stream record. Name its ordering key, replay window, duplicate strategy, poison path, consumer identity, and the operator signal that shows it is stuck.

Next: Design Azure systems for partial failure.

Series navigation: Previous: Phase 9 data platform lab · Current: Phase 10, Part 1 · Next: Distributed systems and APIs

References

Share this article

LinkedIn post draft