Why Event Grid?
In cloud-native and serverless architectures, applications must react to events in real time. Instead of polling resources, Azure Event Grid pushes events to subscribers. It’s lightweight, scalable, and designed for event-driven architectures (EDA).
1. Event Grid Basics
Definition:
Fully managed, serverless event routing service based on publish/subscribe model.
Key Features:
-
Near real-time event delivery (<1 second latency).
-
Push model (no polling required).
-
Supports millions of events per second.
-
Guaranteed at-least-once delivery.
-
Native integration with Azure services.
2. Event Sources
Event Grid can capture events from:
-
Azure services (Blob storage, Resource Groups, Event Hubs).
-
Custom apps (via custom topics).
-
Partner services (e.g., SaaS providers).
Example:
-
Blob Storage event → fires when a new file is uploaded.
-
Azure Resource Group event → fires when a VM is created.
3. Event Handlers (Subscribers)
Subscribers can be:
-
Azure Functions (serverless processing).
-
Logic Apps (workflow automation).
-
Event Hubs (big data ingestion).
-
Webhooks (custom apps).
Example:
-
Blob upload event → triggers Function to resize image.
-
New user signup event → triggers Logic App to send welcome email.
4. Event Filtering
-
Supports event type filtering (only receive relevant events).
-
Advanced filtering (prefix/suffix matching on subject, numbers, strings, Boolean).
5. Reliability & Security
-
Retry policies with exponential backoff for failed deliveries.
-
Event dead-letter destination (e.g., Blob or Storage Queue).
-
Secure with Azure AD authentication or SAS tokens.
Example Enterprise Scenario
A media platform requires:
-
Triggering image resizing when a user uploads a photo.
-
Sending notifications when new content is published.
-
Logging all failed event deliveries.
Correct design:
-
Use Event Grid Blob trigger → Function for resizing.
-
Use Event Grid Topic → Logic App for notifications.
-
Configure dead-letter destination in Blob storage.
Confusion Buster
-
Event Grid vs Event Hubs
-
Event Grid = discrete events, pub/sub, serverless.
-
Event Hubs = data streaming (telemetry, logs).
-
-
Event Grid vs Service Bus
-
Event Grid = lightweight, fire-and-forget, millions/sec.
-
Service Bus = enterprise messaging, ordering, DLQ.
-
-
Webhook vs Logic App Handler
-
Webhook = custom code subscriber.
-
Logic App = no-code automation subscriber.
-
Exam Tips
-
“Which Azure service routes events in real time with low latency?” → Event Grid.
-
“Which service provides pub/sub for lightweight eventing?” → Event Grid.
-
“Which Event Grid feature handles undeliverable events?” → Dead-letter destination.
-
“Which service is best for reacting to blob uploads in real time?” → Event Grid.
What to Expect in the Exam
-
Direct Q: “Which Azure service uses publish/subscribe for event-driven integration?” → Event Grid.
-
Scenario Q: “Retailer wants to trigger notifications when a new order is placed.” → Event Grid with Logic App.
-
Scenario Q: “Media app must resize images when uploaded to Blob Storage.” → Event Grid + Function.
-
Trick Q: “Event Grid is designed for streaming millions of telemetry events continuously.” → False (that’s Event Hubs).