Is there an Azure Function trigger support for Event Grid Namespace Topic?

Philip Leung 20 Reputation points
2024-05-30T04:42:51.3633333+00:00

Hi

There is an EventGridTrigger attribute for Azure Function that can be used to handle custom topic event. I wonder if there is an equivalent for Event Grid Namespace Topic with the pull model event subscription. I cannot find any example online.

What would be the recommended way of consuming these events from the Namespace Topic if Azure function trigger support is not available?

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,635 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
349 questions
{count} votes

Accepted answer
  1. Vlad Costa 860 Reputation points
    2024-05-30T05:13:52.82+00:00

    There isn’t a direct equivalent to the EventGridTrigger attribute for Azure Functions.

    You can use the pull delivery model to consume events from the Namespace Topic. With pull delivery, your application connects to Event Grid to read CloudEvents using queue-like semantics. This allows you to consume events at your own pace, scale, or an ingress rate your application supports.

    Reference: https://learn.microsoft.com/en-us/azure/event-grid/pull-delivery-overview

    ps.: Please mark it as an accepted answer if the answer helped you.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Gowtham CP 3,730 Reputation points
    2024-05-30T05:27:09.3933333+00:00

    Hello Philip Leung ,

    Thanks for reaching out in the Microsoft Q&A!

    Currently, Azure Functions does not have a built-in pull trigger for Event Grid Namespaces. Here are your options:

    • Utilize the existing Event Grid Trigger with a webhook (push model). This approach allows your function to receive notifications as soon as events are published. For more details, refer to the Microsoft Documentation.
    • Alternatively, create Event Hubs and set up a pull subscription on the Namespace Topic. Then, use the Event Hub Trigger in your function for a pull-based approach. Detailed guidance can be found in the Event Hubs Triggers documentation.

    If you find this helpful, please accept this answer to close the thread. Thanks!

    1 person found this answer helpful.
    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more