Azure EventGrid webhook validation error

Prajnan Kotoky 0 Reputation points
2024-07-24T04:43:22.42+00:00

Hi
I am trying to set an Event Grid subscription as webhook endpoint whose URL is pointing to my internal only API Management instance. If I point to my staging API Management instance (which is external), webhook is successfully created. Is it mandatory that my URL be public if I want to create an Event Grid subscription of type webhook endpoint? Please suggest

To test my internal webhook URL, I sent a POST request via Postman and can confirm it is returning 200 Status Code and ValidationResponse code as expected. I have followed the documentation https://learn.microsoft.com/en-us/azure/event-grid/webhook-event-delivery#endpoint-validation-with-event-grid-events

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,952 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
354 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2024-07-24T04:43:22.4566667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It is not mandatory for your webhook URL to be public in order to create an Event Grid subscription of type webhook endpoint. However, if your webhook URL is not public, you will need to make sure that your endpoint code participates in a validation handshake with Event Grid. Event Grid supports two ways of validating the subscription: synchronous and asynchronous handshake. If you're creating an event subscription with an SDK or tool that uses API version 2018-05-01-preview or later, Event Grid sends a validationUrl property in the data portion of the subscription validation event. To complete the handshake, find that URL in the event data and do a GET request to it. You can use either a REST client or your web browser. The provided URL is valid for 10 minutes. During that time, the provisioning state of the event subscription is AwaitingManualAction. If you don't complete the manual validation within 10 minutes, the provisioning state is set to Failed. You have to create the event subscription again before starting the manual validation.

    In your case, you have already tested your internal webhook URL and confirmed that it is returning a 200 Status Code and ValidationResponse code as expected. Therefore, you should be able to create an Event Grid subscription of type webhook endpoint with your internal URL.

    References:

    0 comments No comments