Continuous backup for Cosmos DB: the basics
What does periodic backup actually leave you exposed to?
Every Azure Cosmos DB account has a backup policy, and by default that policy is periodic. Periodic backup takes a full snapshot of your partitions on a fixed interval, as often as once an hour, and keeps a couple of copies. It is a real safety net, but it has two sharp edges. The first is granularity: if a bad deployment corrupts data at 10:50 and the last snapshot was taken at 10:00, you can only roll back to 10:00, losing fifty minutes of good writes along with the bad ones. The second is who holds the rope: with periodic backup you cannot restore the account yourself. You raise a support ticket with Microsoft and wait, and that wait is measured in hours while your service is down.
Continuous backup changes both. It backs up each region roughly every 100 seconds and lets you restore to any single second inside a retention window of either seven or thirty days, with one-second granularity. Crucially, the restore is self-service: your own engineers trigger it from the CLI or the portal and a new account is provisioned at the chosen instant, no ticket, no queue. This is the difference between 'we have a backup somewhere' and 'we can be back to 10:49:58 in minutes, on our own.'
Azure Advisor surfaces this as a reliability recommendation: it flags Cosmos DB accounts still on periodic backup and recommends migrating them to continuous backup with point-in-time restore. It is one of the cleanest reliability wins in the catalogue because the migration is a single property change, it is non-disruptive, and for the seven-day tier it adds no backup-storage charge at all. The only catch worth knowing up front is that the migration is one-way: once an account is on continuous backup, you cannot move it back to periodic.
In this lesson you will learn how Cosmos DB backup modes differ, why Azure Advisor recommends moving off periodic backup, how to find every account still on periodic mode, and how to migrate them to continuous backup safely with a single command, including the one-way nature of the change and the prerequisites that can trip you up.
100 seconds versus an hour
Continuous backup snapshots each region of a Cosmos DB account roughly every 100 seconds, yet it lets you restore to any single second you choose inside the retention window, not just to those snapshot points. That one-second granularity is not the same number as the 100-second backup cadence: the backup chain plus the change feed lets the restore reconstruct the exact instant you ask for. Periodic backup, by contrast, can only hand you the moment a snapshot happened to be taken, which on the default policy might be up to an hour before the mistake you are trying to undo.
Finding which Cosmos DB accounts are still on periodic backup
Priya runs the platform team at a SaaS company whose core product sits on a single Cosmos DB account. After a near-miss where a migration script overwrote a slice of the user table, she pulls up the Azure Advisor reliability tab and finds the 'migrate to continuous backup' recommendation flagged against three of her accounts.
Before changing anything, she wants the real inventory: which accounts are still on periodic mode, regardless of what Advisor has gotten round to surfacing, so she can decide which need the full thirty-day window and which are fine on seven days.
List every Cosmos DB account and its current backup policy type, so you can see at a glance which are still on periodic mode.
The accounts holding live, customer-facing data on Periodic mode are the highest-value targets: they are the ones where a self-service restore saves the most downtime.
How continuous backup and point-in-time restore actually workdeep dive
Under the covers, the backup policy is a property on the account: 'backupPolicy.type' is either 'Periodic' or 'Continuous', and for continuous mode 'continuousModeProperties.tier' is either 'Continuous7Days' or 'Continuous30Days'. Periodic mode takes independent full backups of each physical partition on the configured interval, with no synchronisation across partitions. Continuous mode instead backs up each region roughly every 100 seconds and retains a chain that, combined with the change feed, can reconstruct the state of the account at any chosen second inside the retention window. That is why the restore granularity is one second even though the backup cadence is about 100 seconds.
A point-in-time restore does not roll the existing account back in place. It provisions a brand-new account containing the data as it existed at the timestamp you specify, leaving the original untouched. That is a deliberate safety property: you recover into a clean account, verify it, and then cut over, rather than mutating the live account during an incident. The trigger is a single CLI command that names the source account, the target account, the location and the UTC restore timestamp.
Two operational details matter. First, migration from periodic to continuous is one-way and irreversible, so you treat it as a deliberate commitment rather than a toggle to flip and flip back. Second, there are prerequisites: the account must be a supported API (NoSQL, Table, Gremlin or MongoDB), it must not have had Azure Synapse Link disabled on a container after enabling it, and if it uses customer-managed keys you must have a managed identity declared in the Key Vault access policy and set as the account's default identity. Check these before you run the migration, not after it fails.
What is the impact of staying on periodic backup?
The direct impact is recovery time and recovery precision during an incident. On periodic backup, a logical corruption (a bad migration, a faulty bulk write, an accidental container delete) is recovered by opening a support ticket with Microsoft and restoring from the most recent snapshot. That introduces queue time you do not control and a restore point that can be up to an hour stale, so you lose the good writes between the last snapshot and the mistake. During a customer-facing outage, every one of those minutes is downtime.
The second-order impact is who is in the loop. Periodic restore puts a vendor in your critical path at the worst possible moment, when your service is down and the clock is running. Continuous backup removes that dependency entirely: your own on-call engineer triggers the restore from the CLI to the second before the incident, provisions a clean account and cuts over, with no external ticket and no waiting. That is the difference between an incident you can resolve inside your own runbook and one that stalls on someone else's queue.
There is also a quiet reliability dividend. Continuous backups are taken in every region the account spans, are locally redundant by default and zone-redundant where availability zones are enabled, so the recovery posture tracks the account's own geography automatically. Staying on periodic backup means leaving a more precise, more self-sufficient, often cheaper recovery model on the table, which is exactly why Azure Advisor raises it as a reliability recommendation rather than a nice-to-have.
How do you migrate to continuous backup safely?
Treat this as a deliberate, account-by-account migration rather than a blanket flip, because the change is one-way. The order matters: check prerequisites and pick the right tier before you migrate, because you cannot go back to periodic afterwards.
1. Inventory accounts by backup mode and data value
List every Cosmos DB account and its current 'backupPolicy.type'. Separate the accounts still on Periodic mode from those already on Continuous, and for each periodic account note the data it holds and the cost of an hour of its downtime. That data value decides which tier each account needs.
2. Confirm the prerequisites for each account
Check that the account is a supported API (NoSQL, Table, Gremlin or MongoDB), that Azure Synapse Link has not been disabled on a container after being enabled, and that any account using customer-managed keys has a managed identity declared in its Key Vault access policy and set as its default identity. These are the conditions that cause a migration to fail, so verify them first.
3. Pick the tier per account, then migrate
Choose Continuous7Days for accounts that only need a week of restore history (it adds no backup-storage charge) and Continuous30Days for accounts whose downtime cost justifies the full thirty-day window and its documented per-GB storage charge. The migration is a single 'az cosmosdb update' command and is non-disruptive to the live account, but remember it cannot be reversed.
4. Rehearse the restore and write the runbook
A backup you have never restored from is a hope, not a plan. Trigger a point-in-time restore into a throwaway target account to prove the path works end to end, time it, and capture the exact command in your incident runbook so the on-call engineer can run it under pressure without improvising.
# Migrate a Cosmos DB account from periodic to continuous backup (30-day window).
# This is one-way: the account cannot be moved back to periodic afterwards.
az cosmosdb update \
--resource-group core-prod \
--name prod-users \
--backup-policy-type Continuous \
--continuous-tier Continuous30Days
# Verify the new policy took effect.
az cosmosdb show --resource-group core-prod --name prod-users \
--query "backupPolicy" -o json
# Rehearse: restore to a point in time into a NEW throwaway account.
# The source account is untouched; a fresh account is provisioned at the timestamp.
az cosmosdb restore \
--resource-group core-prod \
--account-name prod-users \
--target-database-account-name prod-users-restore-test \
--restore-timestamp 2026-06-17T09:30:00+00:00 \
--location uksouth Quick quiz
Question 1 of 5Azure Advisor flags a Cosmos DB account to migrate from periodic to continuous backup. What is the core reliability benefit it is pointing at?
You scored
0 / 5
Keep learning
Go deeper on how Cosmos DB backup modes work and how to migrate and restore safely.
- Continuous backup with point-in-time restore in Azure Cosmos DB How continuous backup works, the seven-day and thirty-day tiers, and what restore granularity you get.
- Migrate from periodic to continuous backup mode The prerequisites, the one-way nature of the migration, and the CLI, PowerShell and Bicep paths.
- Restore an account that uses continuous backup mode How to run a self-service point-in-time restore into a new account from the CLI or portal.
You can now treat Cosmos DB backup as a recovery capability rather than a default setting: inventory which accounts are still on periodic mode, check the prerequisites, pick the seven-day tier where a week is enough and the thirty-day tier where the data's downtime cost justifies it, migrate with a single command, and rehearse the restore so the runbook is proven before you ever need it. Remember the migration is one-way, so make it deliberately.
Back to the library