Azure EventGrid webhook validation error

Prajnan Kotoky 20 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 Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
379 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 27,176 Reputation points
    2024-07-24T17:51:07.7766667+00:00

    @Prajnan Kotoky Thanks for reaching out. To create an Event Grid subscription of type webhook endpoint, the webhook URL must be publicly accessible. This is because Event Grid needs to be able to send events to the webhook URL, and it cannot do so if the URL is not accessible from the internet.

    do let me know incase of further queries, I would be happy to assist you.

    0 comments No comments

1 additional 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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.