When trying to provision a Webhook or Event Grid subscription, one may see a Status = Failed error message for the subscriptionId requested:
This typically occurs as a result of a missing handshake validation response from the webhook and/or EventGrid endpoint URL that was used during the subscription creation step.
When a SkyHook subscription is being provisioned, a handshake validation will be executed using the abuse protection semantics of CloudEvents v1.0. The validation request uses the HTTP OPTIONS method for reference.
Upon a subscription request being sent, the indicated endpoint will receive the handshake validation request, where one can then opt to validate the request using the following approaches:
- Including the HTTP Header fields WebHook-Allowed-Origin and WebHook-Allowed-Rate and their respective values to the HTTP 200 response.
- Executing a call to the endpoint url from HTTP Header field WebHook-Request-Callback and return HTTP 200 response.
More details on this workflow can be found in the following CloudSpecs documentation: https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#41-validation-request
NOTES:
- Please ensure the HTTP Header fields WebHook-Allowed-Origin and WebHook-Allowed-Rate are using the correct values. For example, the WebHook-Allowed-Origin header should return the value that was received in the request header originally.
- A basic code example representing the webhook endpoint that includes the handshake validation can be seen below: