I need to implement automatic failover to the secondary (passive) region for internal service. This service is a Function App that does some work on different events, including timers.
Here is my current understanding of how I can achieve this:
Use SQL Server with the auto-failover group for leasing of leadership between regions. This approach is described here: https://www.youtube.com/watch?v=5h2aS0_YckI
Use Cosmos DB with the single-write region and auto-failover. This is similar to the above approach. Some more info here: https://docs.microsoft.com/en-us/azure/cosmos-db/high-availability
My question now is if there is a solution how to implement it with Front Door or with Traffic Manager. Here is a sketch:
Traffic Manager is set to Priority mode. The primary region has priority 1 and secondary 2. Both regions periodically send "Ping(name of region)" to the traffic manager URL. Now, the traffic manager directs these ping requests to the active, healthy region, so when a region receives a "Ping" message then it assumes that it is currently active, and performs work assuming to be a leader. It appears to make sense, but I'm concerned, if I can have a split-brain situation here (when both regions think they are active/leaders).
Can anyone please help reason if there is an approach with Traffic Manager or Front Door may work without split-brain?
Thank you very much in advance,
