Girish Acharya
Girish Acharya

Reputation: 285

Not able to add webhook subscription to the Azure Event Grid

I am not able to add a new WebHook subscription in the Azure Event Grid. Can someone help? I am getting below error when I add the webhook endpoint.

{
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "Url validation",
        "message": "The attempt to validate the provided endpoint https://webapplication120180427035159.azurewebsites.net/api/values?id=AMif5RXS+Bs0bgsbHnNP8RUcn8ZacH8ETUzHXZ5YlNM= failed. For more details, visit https://aka.ms/esvalidation."
      }
    ]
  }

Upvotes: 2

Views: 7112

Answers (1)

Sean Feldman
Sean Feldman

Reputation: 25994

When registering a webhook with Azure Event Grid, your code has to handle validation call. You can follow this sample showing how to receive validation code and reply back to ensure subscriber is registered properly.

At the moment, this is the only way to perform validation, via code that handles all regular (non-validation) events.

If you are using Azure Functions, you could use EventGridTrigger instead of HttpTrigger. It will handle validation handshake for you leaving your Function to focus on the "normal" events only.

Upvotes: 10

Related Questions