0
0
Azurecloud~10 mins

Event Grid subscriptions and filters in Azure - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Event Grid subscriptions and filters
Event Published
Event Grid Topic
Subscription Filter Check
Send Event
Event Delivered to Subscriber
Events are published to a topic, then each subscription checks filters. If filters match, event is sent to subscriber; otherwise, it is dropped.
Execution Sample
Azure
1. Create Event Grid Topic
2. Create Subscription with filter on eventType = 'orderCreated'
3. Publish event with eventType 'orderCreated'
4. Event delivered to subscriber
5. Publish event with eventType 'orderCancelled'
6. Event dropped (filter mismatch)
This sequence shows how Event Grid delivers events only to subscriptions whose filters match the event.
Process Table
StepEvent TypeFilter ConditionFilter Match?ActionResult
1orderCreatedeventType == 'orderCreated'YesSend EventEvent delivered to subscriber
2orderCancelledeventType == 'orderCreated'NoDrop EventEvent not delivered
💡 No more events to process
Status Tracker
VariableStartAfter Step 1After Step 2Final
eventTypenoneorderCreatedorderCancelledorderCancelled
filterConditioneventType == 'orderCreated'unchangedunchangedunchanged
filterMatchfalsetruefalsefalse
Key Moments - 2 Insights
Why does the event with type 'orderCancelled' not reach the subscriber?
Because the subscription filter only allows events where eventType equals 'orderCreated'. The execution_table row 2 shows filterMatch is No, so the event is dropped.
Can multiple subscriptions with different filters receive the same event?
Yes. Each subscription independently checks its filter. If multiple filters match the event, all those subscriptions receive it. This is implied by the filter check step in the concept_flow.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the filterMatch value at Step 1?
AUnknown
BNo
CYes
DFalse
💡 Hint
Check the 'Filter Match?' column in execution_table row for Step 1
At which step does the event get dropped due to filter mismatch?
AStep 1
BStep 2
CNo event is dropped
DBoth steps
💡 Hint
Look at the 'Action' column in execution_table to find when 'Drop Event' happens
If the filter condition changed to allow 'orderCancelled' events, what would happen at Step 2?
AEvent would be delivered
BEvent would be dropped
CNo change
DSubscription would be deleted
💡 Hint
Refer to how filterMatch affects Action in execution_table rows
Concept Snapshot
Event Grid subscriptions receive events from topics.
Subscriptions use filters to decide which events to get.
If event matches filter, it is delivered.
If not, event is dropped.
Filters can be on eventType or other properties.
Multiple subscriptions can receive the same event if filters match.
Full Transcript
Event Grid works by sending events from a topic to subscribers. Each subscriber has a subscription with filters. When an event is published, Event Grid checks each subscription's filter. If the event matches the filter, it is sent to the subscriber. Otherwise, it is dropped. For example, a subscription filtering on eventType 'orderCreated' will receive only those events. Events with other types like 'orderCancelled' will be ignored by that subscription. This filtering helps subscribers get only relevant events.