Why using an Event Grid between an Azure Function and a Service Bus or an Event Hub ?

Alexandre 51 Reputation points
2021-04-11T09:20:16.37+00:00

Hello,

I just checked some tutorials from the Microsoft documentation, then I think I'm missing a point.
It is possible to bind an Azure Function directly to a Service Bus or an Event Hub. So, what is the benefit to use an Event Grid Trigger then query the Service Bus or the Event Hub in response to that event ?

First example here, using an Event Grid between a Service Bus and an Azure Function : https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-to-event-grid-integration-function (the same tutorial exists for a Logic App, which also have a Service Bus integration).
Another example here, using an Event Grid between an Event Hub and an Azure Function : https://learn.microsoft.com/en-us/azure/event-grid/event-grid-event-hubs-integration

I tried to find some explanations but without success. Is there a specific documentation where I can find informations about that method ?

Thanks a lot
Alexandre

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
541 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
554 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
311 questions
0 comments No comments
{count} vote

Accepted answer
  1. Pramod Valavala 20,516 Reputation points Microsoft Employee
    2021-04-12T07:22:38.05+00:00

    @AlexandreMasson-2318 Behind the scenes, the scale controller monitors sources for events/messages to decide whether to scale a function app out by adding more instances. This is usually achieved by polling the source which counts towards pricing/throughput depending on the service.

    If you have an Event Hub or Service Bus that doesn't have a constant in flow of messages, you could switch to using the Event Grid trigger which triggers the function app only when there are messages with no active listeners.

    A beneficial use case for this could be for dead letter queues that need listeners only in case of failures.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful