Clarifying High Availability: Event Hub and Function App Integration Strategies

87592231 65 Reputation points
2024-01-19T14:20:15.38+00:00

We have some confusion between the documentation for Event Hubs and Function Apps regarding High Availability (HA). Let me clarify. In the Event Hubs documentation, it suggests that in case of failover, the secondary (backup) region's Event Hub will receive the events. On the other hand, for Function Apps, the recommendation for non-HTTP trigger handlers is to keep the other region's function idle. To simplify, in the event of a failover, the secondary region's Event Hub is expected to receive the events. However, for Function Apps, it's suggested to keep the secondary region's function idle to avoid processing the same events twice. So, the second region's Event Hub will receive the events along with the primary region's Event Hub during failover.

https://video2.skills-academy.com/en-us/azure/reliability/reliability-functions?tabs=azure-portal
https://video2.skills-academy.com/en-us/azure/event-hubs/event-hubs-geo-dr?tabs=portal

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,566 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
591 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 69,946 Reputation points
    2024-01-22T05:06:41.1066667+00:00

    @87592231 Thanks for reaching out. In the case of Event Hubs, the secondary region's Event Hub will receive the events in case of failover. This is because Event Hubs are designed to provide high availability and disaster recovery capabilities. On the other hand, for non-HTTP trigger Function Apps for the Active-passive pattern your secondary region would be in standby. When you send the messages to the event hub you will be using the alias connection string to send the event. But your primary region function app will be using the primary connection string to listen to the events. Similarly, your secondary region function app would listen to secondary connection string (respective event hub). The function app would not use the alias connection string to listen to the events. In case of disaster recovery when you do the failover of the event hub, automatically your secondary function app will start consuming the events as you were using the respective event hub connection string and not the alias connection string. User's image


0 additional answers

Sort by: Most helpful