Azure Event Grid · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services
A storage account publishes BlobCreated events. An Azure Function should receive only events for .jpg files stored in the photos container. Which Azu…
Practice question from Azure Event Grid (AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services), with the correct answer and a step-by-step solution.
medium · MCQ · Q-2912AD
A storage account publishes BlobCreated events. An Azure Function should receive only events for .jpg files stored in the photos container. Which Azure CLI command creates the most appropriate Event Grid subscription filters?
- A.az eventgrid event-subscription create --name photo-sub --source-resource-id <storage-resource-id> --endpoint <function-endpoint> --included-event-types BlobCreated --subject-begins-with "/blobServices/default/containers/photos/blobs/" --subject-ends-with ".jpg"Correct answer
- B.az eventgrid event-subscription create --name photo-sub --source-resource-id <storage-resource-id> --endpoint <function-endpoint> --included-event-types BlobDeleted --subject-begins-with "/blobServices/default/containers/photos/blobs/" --subject-ends-with ".jpg"
- C.az eventgrid event-subscription create --name photo-sub --source-resource-id <storage-resource-id> --endpoint <function-endpoint> --included-event-types BlobCreated --subject-begins-with "/blobServices/default/containers/documents/blobs/" --subject-ends-with ".jpg"
- D.az eventgrid event-subscription create --name photo-sub --source-resource-id <storage-resource-id> --endpoint <function-endpoint> --included-event-types BlobCreated --subject-begins-with "/blobServices/default/containers/photos/blobs/" --subject-ends-with ".png"
Solution
The included event type limits delivery to BlobCreated events. The subject prefix identifies the photos container, and the subject suffix limits matching blob names to the .jpg extension. Event Grid applies these subscription filters before delivering events to the handler.
More from Azure Event Grid
- A company publishes custom business events when an order is created. The company needs to deliver each event independently to an Azure Func…
- You create an Azure Event Grid event subscription that uses an HTTPS webhook endpoint. During creation, Event Grid sends a SubscriptionVali…
- An Event Grid subscription invokes a payment-processing webhook. Because Event Grid provides at-least-once delivery, the same event can occ…
- A solution must react whenever a blob is created in an Azure Storage account. The team wants Azure to publish the platform-generated storag…
Practise more Connect to and Consume Azure and Third-party Services
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed