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: