0
0
Azurecloud~10 mins

Event Grid subscriptions and filters in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an Event Grid subscription with a filter on the event type.

Azure
az eventgrid event-subscription create --name mySubscription --source-resource-id /subscriptions/123/resourceGroups/myRG/providers/Microsoft.Storage/storageAccounts/myStorage [1] --endpoint https://myendpoint.com/api/events
Drag options to blanks, or click blank then click option'
A--included-event-types BlobCreated
B--included-event-types BlobDeleted
C--subject-begins-with /blobServices/default/containers/images/
D--subject-ends-with .jpg
Attempts:
3 left
💡 Hint
Common Mistakes
Using subject filters instead of event type filters.
Omitting the event type filter option.
2fill in blank
medium

Complete the code to add a subject filter that only accepts events where the subject begins with a specific path.

Azure
az eventgrid event-subscription create --name mySubscription --source-resource-id /subscriptions/123/resourceGroups/myRG/providers/Microsoft.Storage/storageAccounts/myStorage --included-event-types BlobCreated [1] --endpoint https://myendpoint.com/api/events
Drag options to blanks, or click blank then click option'
A--subject-ends-with .png
B--subject-begins-with /blobServices/default/containers/images/
C--subject-contains images
D--subject-equals /blobServices/default/containers/images/
Attempts:
3 left
💡 Hint
Common Mistakes
Using --subject-ends-with instead of --subject-begins-with.
Using --subject-contains which is not a valid filter option.
3fill in blank
hard

Fix the error in the filter syntax to correctly filter events where the subject ends with '.jpg'.

Azure
az eventgrid event-subscription create --name mySubscription --source-resource-id /subscriptions/123/resourceGroups/myRG/providers/Microsoft.Storage/storageAccounts/myStorage --included-event-types BlobCreated [1] --endpoint https://myendpoint.com/api/events
Drag options to blanks, or click blank then click option'
A--subject-ends-with .jpg
B--subject-begin-with .jpg
C--subject-endswith .jpg
D--subject-ends .jpg
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the filter option name.
Using incorrect suffix filter syntax.
4fill in blank
hard

Fill both blanks to create an Event Grid subscription with filters for event type and subject prefix.

Azure
az eventgrid event-subscription create --name mySubscription --source-resource-id /subscriptions/123/resourceGroups/myRG/providers/Microsoft.Storage/storageAccounts/myStorage [1] [2] --endpoint https://myendpoint.com/api/events
Drag options to blanks, or click blank then click option'
A--included-event-types BlobDeleted
B--subject-begins-with /blobServices/default/containers/videos/
C--included-event-types BlobCreated
D--subject-ends-with .mp4
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up event type and subject filter options.
Using incorrect filter values.
5fill in blank
hard

Fill all three blanks to create an Event Grid subscription with filters for event type, subject prefix, and subject suffix.

Azure
az eventgrid event-subscription create --name mySubscription --source-resource-id /subscriptions/123/resourceGroups/myRG/providers/Microsoft.Storage/storageAccounts/myStorage [1] [2] [3] --endpoint https://myendpoint.com/api/events
Drag options to blanks, or click blank then click option'
A--included-event-types BlobCreated
B--subject-begins-with /blobServices/default/containers/images/
C--subject-ends-with .png
D--included-event-types BlobDeleted
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong event type filter.
Confusing subject prefix and suffix filters.