Understanding Azure Event Grid
This lesson explains events and event-driven design, topics, subscriptions and handlers, event schemas, delivery behaviour and how Event Grid differs from Service Bus.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish events from messages.
- Describe system topics, custom topics and domains.
- Compare the Event Grid and CloudEvents schemas.
- Choose between Event Grid, Service Bus and Event Hubs.
Events and event-driven design
An event is a lightweight notification that something happened: a blob was created, a resource was deleted, an order was placed, a model training job finished. Unlike a message in a queue, an event is not a request to do something; the publisher does not know or care who reacts. This lets new behaviour be added by subscribing to existing events, without changing the publisher.
Azure Event Grid routes events from sources to handlers. It pushes each event to every matching subscription within seconds, retries failed deliveries, and scales to very high event rates with no infrastructure to manage. In AI solutions it typically starts ingestion when documents arrive, reacts to Key Vault secret expiry or App Configuration changes, and fans out application events to several consumers.
Event or message?
Topics, subscriptions and handlers
Event Grid's model has three parts. A topic is an endpoint to which events are sent. An event subscription on a topic selects events, through filters, and names the handler to which they are delivered. Several subscriptions on one topic each receive their own copy of matching events.
- System topics represent Azure services that publish events, such as Blob Storage, Key Vault, App Configuration, Azure Container Registry and resource groups. They are created for a source resource, often automatically when the first subscription is created.
- Custom topics are created for applications that publish their own events.
- Event domains group thousands of related topics, for example one per tenant, under one endpoint.
- Partner topics receive events from third-party SaaS providers.
Handlers include Azure Functions (through the Event Grid trigger), webhooks (any HTTPS endpoint, such as an API in Container Apps), Service Bus queues and topics, Event Hubs, Storage queues and Azure Relay hybrid connections. Delivering into a Service Bus queue is a common way to combine Event Grid's push notification with a consumer-paced, reliable queue.
The following diagram shows the event path and the subscription's filters.

Kinds of topic
Event schemas
Events are JSON objects in one of two schemas. A topic's input schema is set when it is created, and subscriptions can deliver in a chosen schema.
| Field purpose | Event Grid schema | CloudEvents 1.0 schema |
|---|---|---|
| Unique identifier | id | id |
| What happened | eventType | type |
| Where it came from | topic (set by Event Grid) | source |
| What it is about | subject | subject |
| When | eventTime | time |
| Payload | data and dataVersion | data and datacontenttype |
CloudEvents is a Cloud Native Computing Foundation standard supported across clouds and tools, and is recommended for new custom topics. The subject field is important in both schemas because filters commonly match on it: for Blob Storage events it is a path such as /blobServices/default/containers/uploads/blobs/report.pdf. An event can be up to 1 MB, and it is billed in 64 KB increments.
Two event schemas
Delivery behaviour
Event Grid's basic delivery model is push: it sends each event to the handler as an HTTPS request and treats a 200 to 204 response as success. Delivery is at least once, so a handler can receive the same event twice and must be idempotent, and order is not guaranteed. Failed deliveries are retried on a schedule, and undeliverable events can be dead-lettered, as the last topic in this module explains.
Event Grid namespaces add a second model: namespace topics support pull delivery, in which consumers receive events, then acknowledge, release or reject them, much like a queue, as well as push delivery, and namespaces also host an MQTT broker for devices. Pull delivery suits consumers that must control their pace or cannot expose an endpoint.
Event Grid, Service Bus or Event Hubs?
Starting ingestion when documents arrive
Users upload contracts to a Blob Storage container named contracts. Each new PDF must be chunked and embedded. A nightly job currently lists the container to find new files, which delays search results by up to a day. The team wants processing within a minute and no polling.
A system topic for the storage account publishes Microsoft.Storage.BlobCreated events. An event subscription filters to that event type, to subjects beginning with /blobServices/default/containers/contracts/ and ending with .pdf, and delivers to an Azure Functions Event Grid trigger (or to a Service Bus queue if processing must be paced). The handler checks whether the blob was already processed, so a repeated event is harmless.
A timer that lists the container every minute is still polling and becomes expensive as the container grows. A Service Bus queue alone has no way to learn of new blobs. Event Hubs is designed for streams, not for reacting to individual blob events.
Why must Event Grid handlers be idempotent?
Show answer
Event Grid delivers at least once, so the same event can arrive more than once, and order is not guaranteed.
Exam Tips
Remember for the exam
- Event Grid pushes notifications from topics to subscribed handlers; publishers do not know subscribers.
- System topics for Azure services, custom topics for applications, domains for many related topics.
- Delivery is at least once and unordered; handlers must be idempotent.
- Event Grid for things that happened; Service Bus for work to do; Event Hubs for telemetry streams.