In the previous post, we discussed setting up global replication of your Azure Cosmos DB database using the Azure portal. Once your Geo-Replication is configured, you can also specify the priorities for your data center regions to decide which data center to go first for failover in case of a disaster. Azure Cosmos DB enables us to tag a priority to every data center regions which are attached to your geo-replicated Cosmos DB instance.
To configure the Failover priorities, from the Geo-Replication window, select the “Automatic Failover” option. Turned it on, and then drag and drop the region in reading the section to change your priorities.
In case of an outage, Azure Cosmos DB ensure the automatic failover is on and sequence occurs in the priority of the order that we have specified.
While this is very easy to configure & setup in the Azure Portal – You can also manage this programmatically with the help of Cosmos DB Resource Provider – Database Accounts – Failover Priority Change
The Failover Priorities are set for the read regions and Azure Cosmos DB ensure the failover based on the priorities specified – In case of outage. If there is an outage on the Write Region, when automatic failover is configure, then the Write region is automatically marked as offline and , an alternative region is promoted as the write region
You can also setup the Manual Failover ( Select a Read Region to become the new Write Region) by manually changing the current write region to any of the replicated read region. In this case, select the “Manual Failover” option, and then select the regions for failover from one of the read region.
Read more about Azure Cosmos DB Failover from here..
Hope this helps.