Complete the code to create an Event Grid topic in Azure.
az eventgrid topic create --name [1] --resource-group MyResourceGroup --location eastusThe --name parameter specifies the name of the Event Grid topic to create. Here, MyTopic is a valid topic name.
Complete the code to create a subscription for the Event Grid topic.
az eventgrid event-subscription create --name MySubscription --source-resource-id /subscriptions/1234/resourceGroups/MyResourceGroup/providers/Microsoft.EventGrid/topics/MyTopic --endpoint [1]
The --endpoint parameter requires a full HTTPS URL where events will be delivered. https://myendpoint.com/api/events is a valid secure endpoint.
Fix the error in the event subscription filter to only receive events of type 'Microsoft.Storage.BlobCreated'.
az eventgrid event-subscription create --name MySubscription --source-resource-id /subscriptions/1234/resourceGroups/MyResourceGroup/providers/Microsoft.EventGrid/topics/MyTopic --endpoint https://myendpoint.com/api/events --included-event-types [1]
The --included-event-types parameter requires the full event type string. Using Microsoft.Storage.BlobCreated filters correctly for that event type.
Fill both blanks to create an Event Grid subscription with a filter for subject begins with 'images/' and subject ends with '.jpg'.
az eventgrid event-subscription create --name MySubscription --source-resource-id /subscriptions/1234/resourceGroups/MyResourceGroup/providers/Microsoft.EventGrid/topics/MyTopic --endpoint https://myendpoint.com/api/events --subject-begins-with [1] --subject-ends-with [2]
The --subject-begins-with and --subject-ends-with parameters filter events by subject prefix and suffix. Using images/ and .jpg matches subjects starting with 'images/' and ending with '.jpg'.
Fill all three blanks to create an Event Grid subscription with dead-lettering enabled to a storage blob container.
az eventgrid event-subscription create --name MySubscription --source-resource-id /subscriptions/1234/resourceGroups/MyResourceGroup/providers/Microsoft.EventGrid/topics/MyTopic --endpoint https://myendpoint.com/api/events --deadletter-endpoint [1] --max-delivery-attempts [2] --event-ttl [3]
The --deadletter-endpoint must be a valid Azure Blob Storage container URL for dead-lettering. https://mystorageaccount.blob.core.windows.net/deadlettercontainer is correct. --max-delivery-attempts sets retry attempts (5 is reasonable). --event-ttl sets event time-to-live in minutes (1440 = 1 day).