Implement solutions that use Azure Event Grid
Azure Event Grid is a serverless event routing service that connects event sources to event handlers. An event source, such as a storage account, a resource group, or a custom application, publishes events to an Event Grid topic. A topic can be a system topic for Azure services or a custom topic for your own applications. Event Grid then forwards each event to every event subscription that has been created on that topic, but only if the event matches the subscription's filter. Filters can match on event type, subject prefix/suffix, or advanced fields, so a single topic can serve many different handlers.
Each event subscription defines a destination—the handler that will process the event. Common handlers include Azure Functions, webhooks, Azure Logic Apps, and Azure Automation. Event Grid guarantees at-least-once delivery and uses an exponential backoff retry policy for failed deliveries, with a configurable maximum retry count. Events that still cannot be delivered after retries expire can be sent to a dead-letter endpoint, typically a blob storage container, so no event is lost. Since Event Grid is serverless, it scales automatically and you pay only for the number of events published (per million), making it ideal for reacting to state changes across Azure resources without polling.
The flow is one-directional: a publisher sends an event to a topic, the topic checks all subscriptions, and for each subscription that passes the filter, Event Grid pushes the event to the specified handler. There is no persistence—events are delivered in near real-time and are not stored for later consumption. This makes Event Grid suitable for event-driven workflows, such as automatically resizing an image when a blob is uploaded or triggering a function when a resource is created or deleted.
Implement solutions that use Azure Event Hubs
Azure Event Hubs is a big-data streaming platform and event ingestion service. It can receive millions of events per second from devices, applications, or other services and stream them to multiple consumers for real-time processing or later analysis. Event Hubs organizes incoming events into partitions within an event hub namespace. Partitions are ordered sequences of events; sending applications do not need to specify a partition directly, but can do so using a partition key to keep related events together. Each partition maintains the order of events, and all events within a partition are processed in the order they arrived.
Consumers read events from Event Hubs by joining a consumer group. A consumer group is a logical view of the entire event hub that allows multiple consumer applications to read from the same stream independently. Within a consumer group, each partition should be read by only one consumer instance to avoid duplicate processing. For this, consumer applications typically implement checkpointing—saving the offset (position) of the last processed event to a checkpoint store, such as Azure Blob Storage. When a consumer restarts, it resumes from the last checkpoint, ensuring exactly-once or at-least-once semantics depending on the application logic.
Event Hubs supports both AMQP and HTTPS protocols for sending events, with AMQP offering higher throughput and lower latency. Throughput (events per second) is managed by throughput units (TU) or processing units in the standard and premium tiers; each TU provides a specific inbound and outbound bandwidth. For high durability, Event Hubs retains events for a configurable retention period (1–7 days by default, up to 90 days with Azure Storage capture). You can also enable Azure Event Hubs Capture to automatically write all incoming events to Azure Blob Storage or Azure Data Lake Storage in an Avro format, providing permanent storage for batch processing. Event Hubs is the right choice when you need to ingest large volumes of data quickly, support multiple independent consumers, and retain events for replay or archival—unlike Event Grid, which is designed for reactive event routing rather than high-throughput streaming.