Azure Event Grid · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services

You create an Azure Event Grid event subscription that uses an HTTPS webhook endpoint. During creation, Event Grid sends a SubscriptionValidationEven…

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-CB7130

You create an Azure Event Grid event subscription that uses an HTTPS webhook endpoint. During creation, Event Grid sends a SubscriptionValidationEvent containing a validationCode. What should the webhook do to complete validation?

  1. A.Return HTTP 200 with the validationCode as plain text in the response body
  2. B.Return HTTP 200 with a JSON body containing the validationCode in the validationResponse propertyCorrect answer
  3. C.Send the validationCode to the Event Grid topic as a new event
  4. D.Return HTTP 202 and wait for Event Grid to validate the endpoint asynchronously

Solution

For webhook validation, the endpoint must recognize the SubscriptionValidationEvent and synchronously return HTTP 200 with a JSON response such as {"validationResponse":"<validationCode>"}.

More from Azure Event Grid

All of Azure Event Grid

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 free

Free to start · No credit card needed