Request validation

When a domain event subscription is created, the Azure event grid system automatically sends an OPTIONS request to the provided URL.
This request contains a request header named webhook-request-callback, The value of this header is an URL that the domain event subscriber needs to call, either by GET or POST, to validate the subscription.

Note that the HTTP GET operation sent to the azure validation endpoint must be sent after the server has responded with 200 OK on the OPTIONS request. Validation will fail if performing the GET as part of the OPTIONS request processing.

No domain events will be dispatched until this step has been completed.

It is important that the validation process is automated, because any changes to the azure event grid subscription triggers a redeploy and subsequent revalidation. Failure to validate the subscription will disable the subscription and hence stop the flow of events.