Why it matters
Backup retention is often raised once and never revisited, and on large accounts the extra copies can cost as much as the data.How nOps finds it
nOps reads the last 14 days of Cosmos DB billing. An account is flagged when it paid for backup storage on at least 7 of those days, was billed recently, and had no continuous-backup charges (so it uses periodic backup). The saving is the backup storage cost from the last 7 days, scaled to a month. This is an upper bound: billing does not show your interval or retention. Services mostly paid with credits and savings under $5 a month are left out.Before you start
Know the backup retention your owners or compliance rules require.How to implement
- Check the retention you actually need with the account owner.
- In the Azure portal, open the Cosmos DB account and go to Backup & Restore.
- Set the backup retention to twice the backup interval (for example, a 24-hour interval with 48 hours of retention), or lengthen the interval while keeping the retention you need. Consider locally or zone-redundant backup storage if geo-redundant copies are not required.
- Or use the Azure CLI:
az cosmosdb update --resource-group RESOURCE_GROUP --name ACCOUNT --backup-interval 1440 --backup-retention 48. - Update Terraform, Bicep or ARM templates (the
backupblock) so a later deployment does not change it back.
Risks and considerations
- Shorter retention means you can restore from fewer points in time.
- Continuous backup is billed differently and is not covered by this recommendation.
- To roll back, raise the retention again; it applies to backups taken from then on.
FAQs
Why is the saving an upper bound?
Why is the saving an upper bound?
Billing shows the backup storage charge but not your interval or retention. Going back to two copies removes the whole charge; a smaller change saves part of it.