Spanning Cosmos DB across regions: the basics
What does a single-region Cosmos DB account actually risk?
An Azure Cosmos DB account placed in a single region is highly resilient inside that region: Cosmos DB keeps multiple replicas of your data behind a quorum, and within a region a node failure is invisible to your application. What it cannot survive is the loss of the whole region. If the Azure region hosting that account has an outage, the account is unreachable for reads and writes until the region recovers, and there is no second copy of the data anywhere else to fall back to. For a production workload, that is the difference between a transparent blip and a full outage.
Azure Advisor surfaces exactly this gap. Its reliability recommendation 'Add a second region to your production workloads on Azure Cosmos DB' fires on accounts that run in a single region, under the Business Continuity category for the resource type microsoft.documentdb/databaseAccounts. The recommendation's own guidance is direct: production workloads running in a single region can have availability issues, and you increase availability by configuring the account to span at least two Azure regions, with a single write region and at least one additional read region, and service-managed failover enabled.
Most single-region accounts are not single-region on purpose. An account is created in one region for a proof of concept, the workload quietly becomes production, and nobody revisits the topology. The work in this lesson is to find every production Cosmos DB account that is still single-region, add a second region with the right failover priority, turn on service-managed failover so Azure can promote the second region automatically, and understand what that does and does not protect against, so the resilience you buy matches the resilience you think you bought.
In this lesson you will learn why a single-region Cosmos DB account is a single point of failure, how Azure Advisor detects it, and how to add a second region and service-managed failover safely without taking the account offline. You will also learn what multi-region does and does not protect against, so you can right-size the topology per workload rather than over- or under-spending.
Resilient inside a region, helpless without a second one
A single-region Cosmos DB account already keeps several replicas of your data behind a quorum, so it shrugs off individual machine failures with no downtime at all. That local resilience is so good it can be misleading: teams see an account that never wobbles and assume it is highly available, when in fact its entire fate is tied to one Azure region. The replicas that make it bulletproof against a node failure are all in the same place. Adding a second region is the step that takes resilience from 'survives a server' to 'survives a region,' and it is the one Azure Advisor keeps reminding you about until you take it.
Finding single-region Cosmos DB accounts before an outage finds them
Priya runs platform reliability at a payments company. After a near miss when a dependency had a regional incident, she pulls the Azure Advisor reliability recommendations and sees 'Add a second region to your production workloads on Azure Cosmos DB' flagged on several accounts.
Before changing anything, she lists the Cosmos DB accounts that have only one configured location, so she can separate the genuinely production accounts that need a second region from the dev and test accounts that do not.
List every Cosmos DB account with how many regions it spans, so the single-region production accounts stand out.
A single-region production account is the real finding. A single-region dev account is fine. Match each Advisor hit to the workload before you spend on a second region.
How a second region and service-managed failover actually behavedeep dive
A Cosmos DB account's topology is its 'locations' array. Each location has a region name and a 'failoverPriority': priority 0 is the write region, and any priority greater than zero is a read region, in the order Azure would promote them. A single-region account has exactly one location at priority 0, which is why losing that region loses everything. Adding a location at priority 1 gives the account a second, continuously replicated copy of the data that can serve reads immediately and become the write region if needed.
'enableAutomaticFailover' (set with the CLI flag --enable-automatic-failover, sometimes called service-managed failover) controls what happens when the write region fails. With it on, you have told Azure the failover order through the priorities, and Azure will promote the highest-priority healthy region to be the new write region without you doing anything. With it off, reads still continue from the healthy region during a write-region outage, but write recovery waits for you to act. Either way, a second region is the prerequisite: there is nothing to fail over to without one.
Two behaviours matter for planning. First, service-managed failover is automatic but not instant: Microsoft documents that declaring an outage and triggering it can take a significant amount of time, potentially an hour or more, which is why a forced failover is the faster lever when you need writes back quickly on a critical path. Second, the data-loss exposure on failover depends on the account's consistency level: with strong consistency there is no data loss, while with weaker levels a small window of unreplicated writes could be lost, so the recovery point objective is a property of how you configured consistency, not just of having a second region.
What is the impact of leaving Cosmos DB single-region?
The direct impact is total dependence on one Azure region. A single-region account is fully available only as long as its region is. When that region has an outage, the account is unreachable for reads and writes for the duration, and recovery is entirely in Azure's hands because there is no second copy to serve from. For a production workload, that converts an Azure regional incident directly into your own outage, of the same length.
The availability difference is also documented in the service level. Microsoft publishes higher availability SLAs as you add resilience: a single-region account without availability zones carries a 99.99% availability SLA, a single-region account with zone redundancy 99.995%, and a multi-region account 99.999%. Each extra nine is an order-of-magnitude reduction in expected downtime, and a single-region account sits at the bottom of that ladder.
The second-order impact is that you have no lever to pull during an incident. With a single-region account, your incident response to a region outage is to wait and to communicate. With a second region and service-managed failover, you have options: reads keep serving immediately from the healthy region, writes recover automatically, and for the most critical workloads you can force a failover to restore writes faster than the automatic process. Resilience is partly about avoiding outages and partly about having something you can actually do when one starts.
How do you add a second region safely?
Treat this as a deliberate, per-account change, not a blanket sweep, because each second region costs money. The order matters: confirm the account is production, add the region, then enable service-managed failover, and remember that adding a region must be a separate operation from any other change to the account.
1. Confirm the account is genuinely production
A second region is recurring spend, so only add it where an outage actually costs money. List the single-region accounts, match each to the workload behind it, and ring-fence the production, customer-facing accounts. Dev, test and sandbox accounts can stay single-region by design.
2. Add the second region as its own operation
Add a location at the next failover priority, picking a paired or nearby region that suits your latency and residency needs. Adding or removing a region must be done on its own: you cannot change a region and another account property in the same call. Cosmos DB fully replicates the data into the new region before marking it available, so this is a non-disruptive online operation.
3. Enable service-managed failover
Once the account has two or more regions, turn on service-managed failover so Azure promotes the highest-priority healthy region automatically if the write region fails. Set the failover priorities deliberately so the order Azure would promote matches your intent. Without this, reads still survive a write-region outage but write recovery waits on you.
4. Decide your consistency level and rehearse failover
Your recovery point on failover depends on consistency: strong consistency means no data loss, weaker levels risk a small window of unreplicated writes. For the most critical path, rehearse a forced failover in a drill, because service-managed failover can take an hour or more to trigger, and a forced failover is the faster lever when you need writes back quickly.
# Step 1: add a second region. This must be its own operation; you cannot
# change regions and other account properties in the same call. Keep the
# existing write region at priority 0 and add the read region at priority 1.
az cosmosdb update \
--name payments-prod \
--resource-group rg-payments \
--locations regionName="West Europe" failoverPriority=0 isZoneRedundant=False \
--locations regionName="North Europe" failoverPriority=1 isZoneRedundant=False
# Step 2: once the account spans two regions, enable service-managed failover
# so Azure promotes the read region automatically if the write region fails.
accountId=$(az cosmosdb show -g rg-payments -n payments-prod --query id -o tsv)
az cosmosdb update --ids "$accountId" --enable-automatic-failover true
# Drill only: force a failover to test recovery (promotes North Europe to write).
# az cosmosdb failover-priority-change --ids "$accountId" \
# --failover-policies 'North Europe=0' 'West Europe=1' Quick quiz
Question 1 of 5Azure Advisor flags 'Add a second region to your production workloads on Azure Cosmos DB' on an account. What is the underlying risk it is pointing at?
You scored
0 / 5
Keep learning
Go deeper on how Cosmos DB distributes data globally, what failover does, and how the availability SLA changes with topology.
- High availability and reliability in Azure Cosmos DB for NoSQL How multi-region, availability zones and failover combine, and the availability SLA at each tier.
- Distribute your data globally with Azure Cosmos DB How regions, write regions and read regions work in a Cosmos DB account.
- Manage Azure Cosmos DB for NoSQL resources using Azure CLI The exact commands to add regions, enable service-managed failover and trigger a forced failover.
You can now treat single-region Cosmos DB as the continuity risk Azure Advisor says it is: find every production account running in one region, add a second region as its own operation, enable service-managed failover so Azure promotes the secondary automatically, and rehearse a forced failover for the most critical path. Because the second region has a real recurring cost, you also know to spend it per workload, where an outage actually costs money, rather than estate-wide.
Back to the library