I have an Event Grid which is used for publishing events. I have a Web-Hook based subscriber which will be listening to the event. The webhook is hosted on Azure App Service and is protected by an AAD App. In this scenario will Event Grid be able to publish an event to a Web endpoint which is protected by AAD? My event grid topic and the web app are in the same subscription.
1 Answers
According to your description, you want to subscribe a topic of Event Grid via webhook hosted on Azure App Service which be protected by Azure AD.
Per my experience, there are two ways to realize it.
Due to access an url endpoint protected by AAD that be required an access token via AAD authentication, but there is no ablity to do the operation in programming on Event Grid. So as @Roman Kiss said, a workaround way is to create a proxy-like service to get the authorization token to access your webhook, such as using Azure Function App.
However, the other way is to change your app service code to allow anonymous accessing. For example, adding
[AllowAnonymous]
on your controller method if using ASP.NET, please see the Azure Sample code.
hope it helps.