I am trying to create an azure event grid function with a webhook endpoint. But when I try to create my event grid subscription it says:
"Deploying Event Subscription: event-store-in-delta Deployment has failed with the following error: {"code":"Url validation","message":"Webhook validation handshake failed for https://1e8f90c31be0.ngrok.io/runtime/webhooks/EventGrid. Http POST request failed with response code Unknown. For troublehooting, visit https://aka.ms/esvalidation. Activity id:1d113deb-63d2-467a-b21d-36e289fa5b99, timestamp: 6/10/2021 1:01:46 PM (UTC)."}
Has anybody come across this error ?
The HTTP Trigger function needs to implement some validation logic to act as Event Grid endpoint. The Azure documentation provides several pages regarding the issue.
Endpoint validation with Event Grid events
Receive events to an HTTP endpoint
In addition you need to ensure, that your endpoint is accessable by Event Grid. Usually, the Function Key needs to be provided as query parameter
code
in the webhook URL.