Setting up Failover Priorities for Azure Cosmos DB from Azure Portal

By | February 15, 2018

Setting up Automatic Failover for Azure Cosmos DB

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.

Setting up Automatic Failover for Azure Cosmos DB

Setting up Automatic Failover for Azure Cosmos DB


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.

Automatic Failover Priorities

Automatic Failover Priorities

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.

Manual Failover Setup for Cosmos DB

Manual Failover Setup for Cosmos DB

Read more about Azure Cosmos DB Failover from here..

Hope this helps.

Author: Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

2 thoughts on “Setting up Failover Priorities for Azure Cosmos DB from Azure Portal

  1. Pingback: Dew Drop - February 15, 2018 (#2666) - Morning Dew

  2. Pingback: Visual Studio Connected Services for Azure Cosmos DB

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Captcha * Time limit is exhausted. Please reload the CAPTCHA.