Reputation: 21
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 ?
Upvotes: 2
Views: 1245
Reputation: 2075
It looks like you want an Azure Functions EventGridTrigger
instead of an HttpTrigger
. It doesn't require webhook validation at all.
But if you have to use the HTTP trigger and keep getting an unknown
response code, it means that the connection couldn't be established. Ensure you can reach the endpoint outside of Azure. It has to be able to accept a TLS 1.2 (not 1.3) handshake - in Postman, go to the Settings tab, scroll down to "Protocols disabled during handshake" and select all TLS versions but TLS v1.2.
If that doesn't help, I'd try to use something other than ngrok.
Upvotes: 0
Reputation: 7685
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
If you're using any other type of endpoint, such as an HTTP trigger based Azure function, your endpoint code needs to participate in a validation handshake with Event Grid. Event Grid supports two ways of validating the subscription.
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.
Upvotes: 0