0

I'm trying to understand why "It is strongly recommended that you use an Event Grid Trigger when triggering an Azure Function with Event Grid" vs using a generic WebHook. (i.e. the called out note from the MS documentation: https://learn.microsoft.com/en-us/azure/event-grid/receive-events)

The only specific thing I can see from the link is the info about how "endpoint validation is handled for you" when using Event Grid Triggers.

I'm working on a project where currently every Event Grid subscription is set up as a WebHook (despite the majority of the endpoints pointing to Azure Functions). So I'm trying to understand if I should just follow the "norm" and add a new subscription as a WebHook, or if there is good reason to go with an EventGridTrigger instead.

Tap
  • 113
  • 2
  • 5

2 Answers2

0

Why the doc strongly recommended you to use Event Grid Trigger should be only because validation logic built in the preprocessor of the EventGridTrigger.

If you use Generic webhook, you will use more code than eventgridtrigger. Eventgridtrigger only need to input the eventgrid as the paramter. But generic webhook need more operations.

Use generic webhook is ok.

Cindy Pau
  • 13,085
  • 1
  • 15
  • 27
0

@CindyPau's response is correct, but I was trying to find more info about it. Hence, I'm adding my answer.

Based on Webhook event delivery - Azure Docs:

Like many other services that support webhooks, Event Grid requires you to prove ownership of your Webhook endpoint before it starts delivering events to that endpoint. This requirement prevents a malicious user from flooding your endpoint with events.

Then it says:

When you use Azure Functions with Event Grid Trigger^, the Azure infrastructure automatically handles this validation.

^ rephrased

Frank Fajardo
  • 7,034
  • 1
  • 29
  • 47