Question

Difficulty: MediumImplement Azure Event Grid Solutions

You are configuring an Azure Event Grid subscription to route customer events to a third-party HTTP webhook endpoint that you do not control. Because the third-party endpoint cannot be modified to programmatically return the validation code synchronously, you must manually validate the subscription. You create the subscription, and its provisioning state is set to Pending. What must you do to complete the endpoint validation and activate the subscription?

  1. Locate the validation event sent to the webhook destination, copy the validationUrl, and send an HTTP GET request to that URL.Answer
  2. B
    Configure the event subscription to use a system-assigned managed identity, and grant it the EventGrid Contributor role on the destination endpoint.
  3. C
    Generate a Shared Access Signature (SAS) token at the topic level and append it as a query parameter named validationToken to the endpoint URL.
  4. D
    Retrieve the validationCode from the event payload and send an HTTP POST request containing this code to the Event Grid custom topic endpoint.

Answer

To manually validate the subscription, you must locate the validation event sent to the webhook, extract the validationUrl, and send an HTTP GET request to that URL.
When configuring an Event Grid subscription for a webhook that cannot programmatically respond to validation handshakes (such as a third-party service), developers must perform a manual handshake. This is done by intercepting the validation event payload sent to the webhook, copying the validationUrl from the event's data object, and making an HTTP GET request to that URL to activate the subscription.

Step-by-Step Solution

1
Create the Event Grid subscription with the webhook endpoint destination.
The subscription is created in a Pending state, and Event Grid sends a subscription validation event payload containing a validationUrl and a validationCode to the endpoint.
This initiates the validation process to prevent abuse and verify endpoint ownership.
2
Access the delivery logs or request history of the third-party endpoint to retrieve the JSON validation payload.
You obtain the JSON payload which contains the validationUrl property.
Because the third-party endpoint cannot respond programmatically, you must retrieve the URL manually.
3
Perform an HTTP GET request to the retrieved validationUrl.
Event Grid processes the GET request, validates the handshake, and transitions the subscription state to Active.
Making the GET request proves that you have access to the destination's logs and therefore own or control the endpoint.

Key Concept

Azure Event Grid webhook endpoint manual validation handshake
Rate this question