Skip to main content
emnode
Cost

Reserve Azure Cosmos DB capacity

One capability across every Cosmos DB account: find the provisioned throughput you run around the clock at a steady floor, and stop paying the pay-as-you-go rate for request units you were always going to use, by committing to a one or three year reserved capacity purchase.

14 min·10 sections·AZURE

Last reviewed

Reserving Cosmos DB capacity: the basics

What is Azure Advisor actually telling you to buy?

Provisioned throughput on Azure Cosmos DB is billed by the request unit per second (RU/s) per hour, at the pay-as-you-go rate, whether you provisioned that throughput for an afternoon of load testing or have run it continuously for two years. The pay-as-you-go rate is the price of flexibility: you can lower or remove provisioned throughput at any moment and stop paying for it. For a database or container that holds a steady production floor of RU/s month after month, that flexibility is something you are paying for and not using. Azure Cosmos DB reserved capacity is the way to hand the flexibility back in exchange for a lower rate. You commit to a quantity of throughput, bought in multiples of 100 RU/s, for one or three years, pay either monthly or upfront, and the reservation discount applies automatically to any matching provisioned throughput that runs in scope.

Azure Advisor turns this into a concrete cost recommendation: 'Consider Cosmos DB reserved instance to save over the pay-as-you-go costs' (on the microsoft.subscriptions/subscriptions resource type, recommendation ID a205074f-8049-48b3-903f-556f5e530ae3), and Microsoft has since added a related prompt, 'Optimize Your Azure Cosmos DB Costs with New Reserved Capacity Tiers' (ID 6fceeb05-2cea-4774-9f6c-251964d5d5f6), reflecting the larger discount tiers now available. Advisor analyses your actual provisioned throughput over the past 30 days, identifies the RU/s you run consistently, and tells you how much to reserve and what you would save. The recommendation changes nothing on its own. It is a prompt to convert steady, already-committed throughput into committed pricing.

The work is not 'buy reserved capacity'. It is to separate the throughput that genuinely runs steady-state from the throughput that scales up and down with traffic or gets torn down between projects, reserve only the steady floor, and pick the term and scope that match how confident you are. Reserve too little and you leave money on the table; reserve throughput you are about to scale down and you have committed to capacity you no longer need. Reserved capacity also does not apply to serverless accounts at all, only to provisioned throughput, so the first job is knowing which of your accounts are even eligible. The capability is matching commitment to the part of your throughput that was never going anywhere.

In this lesson you will learn how Cosmos DB prices steady throughput, how Advisor identifies how much reserved capacity is worth buying, and how to buy the right reservation, the right quantity of RU/s, term and scope, without committing to throughput you are about to scale down. The walkthrough uses the az CLI to read the recommendation, inspect the provisioned throughput floor, price a reservation before buying, and place the order, with a Bicep example for codifying the purchase.

Fun fact

Paying a deposit you never get back

The pay-as-you-go rate on Cosmos DB throughput is best thought of as a standing option premium: you pay extra, every single hour, for the right to lower or remove that throughput at a moment's notice. For a development database you spin up and tear down, that option is worth every penny. For a production container that has served a constant floor of request units since the day it was deployed and will serve them for years more, you are buying that option afresh every hour and never once exercising it. Reserved capacity is simply you telling Azure you will not be exercising the option on that floor, and Azure handing back most of the premium in return. The database does not change, and the request units behave exactly the same. Only the price does.

Finding what is worth reserving across a subscription

Priya runs the platform team at a SaaS company whose Cosmos DB bill has grown with the product. Cost Management shows Cosmos DB as a large line, and most of it is a stable production floor of provisioned throughput that has not changed in months. Azure Advisor is surfacing the Cosmos DB reserved capacity recommendation on two of their subscriptions.

Rather than buy reserved capacity from the portal estimate alone, Priya starts by pulling the Advisor recommendation and reading the actual provisioned throughput on each account, so she can separate the steady floor that is worth reserving from the autoscaled and short-lived throughput that is not, and rule out the serverless accounts that reservations cannot cover.

Pull the Advisor cost recommendations for the subscription and look for the Cosmos DB reserved capacity prompt. This is the same recommendation the portal shows, read straight from the API.

$ az advisor recommendation list --category Cost --query "[?contains(shortDescription.solution, 'Cosmos DB reserved')].{problem:shortDescription.problem, impact:impact}" -o table
Problem Impact
--------------------------------------------------------------- --------
Consider Cosmos DB reserved instance to save over the pay-as-
you-go costs High
# Advisor sized this from your last 30 days. Now confirm the STEADY RU/s floor.

Advisor flags the opportunity and its size, but it is per subscription and based on a 30 day look-back. Before buying, confirm how much throughput actually runs steady-state so you reserve the floor, not the peak.

How a Cosmos DB reserved capacity discount actually appliesdeep dive

A reserved capacity purchase is a billing construct, not a database resource. When you buy one you choose a quantity of throughput in multiples of 100 RU/s, a term of one or three years (P1Y or P3Y), a billing plan of monthly or upfront, and a scope. You do not attach it to a specific account, database or container. Each hour, Azure looks for provisioned throughput within the reservation's scope and applies the discounted rate to it automatically, up to the reserved quantity; any provisioned throughput above the reserved amount falls back to the pay-as-you-go rate. The discount covers provisioned throughput only: it does not cover storage, networking, or serverless request charges, and serverless accounts get no benefit at all.

Scope decides how widely the discount lands. It can be a single subscription or shared across the whole billing context: a shared scope lets one reservation soak up matching provisioned throughput anywhere in the enrolment, which keeps utilisation high. The discount is use-it-or-lose-it on an hourly basis. If, in a given hour, the matching provisioned throughput in scope is less than the reserved quantity, the unused portion of the reservation for that hour is lost and cannot be carried forward. This is the single most important mechanic to internalise: the reservation pays out only on the throughput that is actually provisioned and running each hour.

Autoscale is supported but priced differently from manual throughput. For an autoscale container, the discount is applied against the consumed throughput scaled by the autoscale ratio, so a reservation sized against an autoscale workload that spends much of its time below its maximum can return less than the same reservation over a manually provisioned floor at the same number. This is why the inventory step matters more than the purchase step: read the real provisioned throughput, reserve the durable floor, and treat the discount as paying out per hour against whatever is genuinely provisioned, not against a peak you rarely hold.

What is the impact of leaving steady throughput on the pay-as-you-go rate?

The direct impact is straightforward: you pay the pay-as-you-go premium, every hour, on throughput you were always going to provision. Microsoft documents Cosmos DB reserved capacity discounts reaching up to 63 per cent against pay-as-you-go for the deepest commitments and largest tiers, so for a large, stable production floor the gap between the pay-as-you-go rate and the reserved rate compounds into a significant recurring overspend. Unlike most optimisations this one requires no change to the workload, no re-partitioning, no re-architecting, just a change to the rate you pay for throughput that already runs.

The second-order impact is that the overspend is invisible by default. A provisioned container does not flag itself as expensive; it just quietly bills at the full rate. Advisor is the thing that surfaces the gap, and if nobody owns the recommendation it persists indefinitely. Every month a steady throughput floor stays on the pay-as-you-go rate is a month of saving that cannot be recovered retroactively, because the discount only applies from the moment the reservation is bought forward.

There is a real but bounded risk on the other side, which is why this is a decision and not an automatic action. Commit to more RU/s than you steadily provision, and you hold a reservation that goes partly unused every hour, because the discount is use-it-or-lose-it. Microsoft mitigates this with self-service exchange and refund, and currently charges no early-termination fee, so an over-bought or stranded reservation can usually be exchanged for a smaller one or partially returned within published limits rather than wasted. The impact of getting it wrong is therefore a recoverable inefficiency, not a sunk loss, provided you reserve the floor and watch utilisation.

How do you buy the right reserved capacity safely?

Work this as a portfolio decision, not a single purchase. The order matters: confirm how much throughput is genuinely steady before you commit, price the reservation before you buy it, and match term and scope to confidence so you are reserving the floor rather than the peak.

1. Read the recommendation and confirm the steady floor

Start from Advisor's Cosmos DB reserved capacity recommendation, then cross-check it against the throughput actually provisioned across your accounts. Advisor sizes its estimate from a 30 day look-back, so a workload that was temporarily scaled up can be over-recommended. Read the provisioned RU/s on each database and container, exclude any serverless accounts, and reserve below the steady minimum, never above the peak, so the reservation stays fully utilised every hour.

2. Choose term and billing plan by confidence

A one year term (P1Y) paid monthly is the low-risk default: short commitment, the monthly bill simply drops. A three year term (P3Y), and paying upfront, saves more but commits the RU/s and the workload for longer. Put the most durable throughput, the core catalogue and API containers, on the longer term, and the merely-probable floor on the shorter term paid monthly.

3. Set scope to keep utilisation high

Prefer shared scope so the discount follows matching provisioned throughput across subscriptions in the billing context rather than stranding on one. Because the discount is use-it-or-lose-it each hour, a shared scope that can soak up matching throughput anywhere is what stops a correctly-sized reservation from going partly unused after a workload moves between subscriptions.

4. Price it, buy it, then monitor utilisation

Always run the calculate step before purchasing so the commitment and saving are confirmed against the live catalogue, never a stale estimate. After buying, track reservation utilisation as an ongoing metric: any reservation persistently below full hourly use is a candidate to exchange for a smaller one or partially refund through Microsoft's self-service process rather than leave stranded.

# 1. Confirm the steady floor: read provisioned throughput before committing.
#    (Serverless accounts return no throughput object and are NOT reservable.)
az cosmosdb sql throughput show \
  --account-name prod-cosmos \
  --name catalogue-db \
  --resource-group prod-rg \
  --query "{manual:resource.throughput, autoscaleMax:resource.autoscaleSettings.maxThroughput}" -o table

# 2. Price the reservation against the live catalogue BEFORE buying.
#    Reserve below the steady RU/s floor, not the peak. Quantity is in
#    multiples of 100 RU/s. (Requires: az extension add --name reservation)
billing_sub="<billing-subscription-id>"
throughput_sku="$(az reservations catalog show \
  --reserved-resource-type CosmosDb \
  --subscription-id "$billing_sub" \
  --query "[0].skuName" -o tsv)"

az reservations reservation-order calculate \
  --reserved-resource-type CosmosDb \
  --sku "$throughput_sku" \
  --location global \
  --quantity 50 \
  --term P3Y \
  --billing-plan Monthly \
  --applied-scope-type Shared \
  --billing-scope "$billing_sub" \
  --display-name prod-cosmos-5000ru-3yr

# 3. Place the order once the calculated price and saving look right.
az reservations reservation-order purchase \
  --reservation-order-id "$(cat /proc/sys/kernel/random/uuid)" \
  --reserved-resource-type CosmosDb \
  --sku "$throughput_sku" \
  --location global \
  --quantity 50 \
  --term P3Y \
  --billing-plan Monthly \
  --applied-scope-type Shared \
  --billing-scope "$billing_sub" \
  --display-name prod-cosmos-5000ru-3yr

Quick quiz

Question 1 of 5

Azure Advisor surfaces 'Consider Cosmos DB reserved instance to save over the pay-as-you-go costs'. What is the most efficient way to act on it?

You can now treat Cosmos DB reserved capacity as one capability: read Advisor's recommendation, confirm how much throughput genuinely runs steady-state, exclude the serverless accounts, reserve the floor below the peak in multiples of 100 RU/s, and match term and scope to how confident you are, pricing the order before you place it and watching utilisation afterwards. The same databases keep running unchanged, they just stop paying the pay-as-you-go premium on throughput that was never going anywhere.

Back to the library