When to use AzureFunction or Webhook as the endpoint type

Mark Lottes 20 Reputation points
2023-06-01T20:24:38.42+00:00

The guidance here in this page

(https://learn.microsoft.com/en-us/azure/event-grid/handler-webhooks) compared to this page (https://learn.microsoft.com/en-us/azure/event-grid/handler-functions) has conflicting or confusing information.

On the first page, (https://learn.microsoft.com/en-us/azure/event-grid/handler-webhooks) it says to use AzureFunction as the endpoint type: "Even though you can use Webhook as an endpoint type to configure an Azure function as an event handler, use Azure Function as an endpoint type. For more information, see Azure function as an event handler.".

Then, on the linked page (https://learn.microsoft.com/en-us/azure/event-grid/handler-functions) it says to use Webhook as the endpoint type.

Which is it?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
456 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pramod Valavala 20,656 Reputation points Microsoft Employee Moderator
    2023-06-05T20:07:51.8033333+00:00

    @Mark Lottes The exception to using WebHook even for Azure Function is only when your function is protected using Azure AD.

    This is because Event Grid only supports key-based authentication when using Azure Functions.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. TP 125.8K Reputation points Volunteer Moderator
    2023-06-01T21:11:38.27+00:00

    Hi Mark,

    You want to use Event Grid Trigger with Azure Function as the endpoint type. The reason is, it will handle the validation response for you. If you do webhook instead, you need to write code to handle the validation response yourself.

    For understand purposes, please see below document where it describes the things you would need to code to properly handle the validation response (if you chose webhook):

    Endpoint validation with Event Grid events

    https://learn.microsoft.com/en-us/azure/event-grid/webhook-event-delivery#endpoint-validation-with-event-grid-events

    Please click Accept Answer if the above was useful. If something is unclear please add a comment.

    Thanks.

    -TP

    1 person found this answer helpful.

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.