Soru

Zorluk: KolayImplement Azure Event Grid Solutions

You are configuring a custom Webhook endpoint to subscribe to events from an Azure Event Grid custom topic. To begin receiving events, your Webhook endpoint must successfully complete the synchronous validation handshake. What must your Webhook endpoint do when it receives the synchronous validation request from Azure Event Grid?

  1. A
    Authenticate the incoming request by verifying that the request headers contain the endpoint's system-assigned managed identity client ID.
  2. B
    Retrieve a SAS token from the request header and save it to an Azure Key Vault secret to establish trust.
  3. Extract the validation code from the request body and return it in the validationResponse property of the JSON response.Cevap
  4. D
    Generate a new cryptographic validation token and return it inside the HTTP headers of the response.

Cevap

Extract the validation code from the request body and return it in the validationResponse property of the JSON response.
When Azure Event Grid sends a subscription validation request to a Webhook endpoint, it includes a validationCode in the request body under the data object. To validate the endpoint synchronously, the subscriber must return this validation code in a JSON response using the validationResponse key.

Adım Adım Çözüm

1
Receive the HTTP POST validation request containing the validation code from Azure Event Grid.
The endpoint receives a request containing a SubscriptionValidationEvent in the body, which holds a validationCode.
Azure Event Grid automatically triggers this request to confirm that the endpoint is owned and controlled by the subscription creator.
2
Extract the validationCode from the data object of the received JSON payload.
The string value of the validationCode is retrieved.
This code must be returned to Event Grid to successfully complete the handshake.
3
Respond to the HTTP POST request with an HTTP 200 OK status code and a JSON response body containing the validationResponse property set to the validationCode.
The validation response is sent back, and Event Grid registers the subscription as active.
Event Grid matches the returned validationResponse to the validationCode it generated to confirm ownership.

Anahtar Kavram

Azure Event Grid synchronous Webhook endpoint validation requires the subscriber to echo back the received validationCode in a JSON response containing the validationResponse property.
Tahmini Süre:1m 0s
Bu soruyu puanla