Question

Difficulty: MediumImplement Azure Event Grid Solutions

You are deploying a custom Webhook endpoint to receive events from an Azure Event Grid custom topic. The solution must use the default Event Grid event schema. To complete the subscription setup, the endpoint must successfully process the automatic, synchronous validation handshake. Which two of the following configuration or code implementation steps must the Webhook endpoint execute to satisfy the Event Grid validation requirements? (Each correct answer presents a part of the solution. Choose two.)

  1. Extract the validationCode value from the data payload of the incoming HTTP POST request.Answer
  2. Return an HTTP 200 OK response with a JSON payload containing the validationResponse set to the extracted validation code.Answer
  3. C
    Send a synchronous HTTP GET request to the validationUrl endpoint provided in the event payload.
  4. D
    Retrieve a Shared Access Signature (SAS) token from Azure Key Vault and send it in the Authorization header of the HTTP response.

Answer

To complete the Event Grid subscription validation handshake, the Webhook endpoint must extract the validationCode from the incoming event data payload and return it in the JSON response body under the validationResponse property along with an HTTP 200 OK status.
The correct actions require the endpoint to process the incoming HTTP POST request, parse the JSON payload to extract the validationCode, and then reply synchronously with a 200 OK status containing the validationResponse field populated with that code.

Step-by-Step Solution

1
Analyze the incoming request payload to locate the verification request.
Identify that the event contains an eventType value of Microsoft.EventGrid.SubscriptionValidationEvent.
Event Grid identifies validation requests using this specific event type.
2
Parse the payload to retrieve the unique verification token.
Extract the validationCode property from the data object of the event.
This code is dynamically generated by Event Grid and must be returned to verify ownership of the endpoint.
3
Formulate and transmit the synchronous HTTP response.
Return HTTP status code 200 OK with a JSON body mapping validationResponse to the extracted validationCode.
Providing the matching validation code in the response payload completes the handshake.

Key Concept

Event Grid Webhook subscription validation handshake
Rate this question