MOFAKH.COM
← Back to profile
Azure Fundamentals

Reading a cost decision: how to check a cloud cost proposal

Nov 25, 202614 min readWritten

Teams record significant decisions in short documents called ADRs, and cost decisions are some of the most common. This part explains the format, then reads a small fictional one (right-sizing and committing the hosting for PhotoDrop's web API) to practise checking every claim against the rules from Parts 6 to 8. It ends with a checklist and a glossary for reading any cost proposal.

This is the ninth part of the Azure series and the last about money. Parts 6, 7 and 8 built the pieces: how a bill is made, provisioned versus serverless compute, and commitment discounts. This part is about using them: reading a written cost proposal and checking whether its numbers and its reasoning hold up.

The worked example is deliberately small and fictional, about the hosting for PhotoDrop's web API, with illustrative prices. The skill it practises is general: the same questions apply to a database, a fleet of VMs, or any other resource a team proposes to resize or commit to.

What an ADR is

An Architecture Decision Record (ADR) is a short document recording one significant technical decision: what was decided, why, what else was considered, and what it costs. Teams keep ADRs alongside their code, numbered in order, so that much later anyone can find out why something is built or paid for the way it is, without relying on memory.

Most ADRs follow a similar skeleton:

SectionAnswers
Statusis this proposed, accepted, or replaced by a later decision?
Contextwhat is true today, with measurements, and which rules constrain the choice?
Decisionwhat exactly will be done?
Options consideredwhat were the alternatives, and why were they rejected?
Consequenceswhat gets easier, what gets harder, what needs revisiting later?
Rollout and rollbackhow will it be introduced, and how is it undone if it goes wrong?

A cost ADR is only as good as its evidence. Reading one well comes down to two habits: check that every number has a source and adds up, and check that every argument follows from a documented rule. The example below is annotated with exactly those checks.


The example: right-size and commit the PhotoDrop API's hosting

Context

The PhotoDrop web API runs on an App Service plan (Part 10 places App Service on the map; for now it is enough that a plan is a set of identical instances, each billed per hour, whether busy or idle). The plan runs a fixed 4 instances, all day, every day.

Illustrative price: USD 0.40 per instance-hour.

Diagram
4 instances × 0.40 × 8,760 hours  ≈  USD 14,000 per year

Measured over the last two months, in "instances' worth" of CPU actually needed:

MeasureInstances needed
p50 (a typical hour)1.2
p901.8
p992.6
busiest moment3.5, briefly, when a weekly newsletter goes out

Check it. The plan is allocated capacity (Part 6): billed every hour it exists. Four instances are paid for around the clock while a typical hour needs barely more than one. The figures are percentiles (Part 7), which is the right basis for sizing. The yearly cost is the standard conversion: instances × price × 8,760 hours.

Constraints

  • At least 2 instances must run at all times, so that one failing or restarting instance does not take the API down (Part 3: copies outside each other's blast radius).
  • App Service can scale out automatically: a rule adds instances when average CPU stays high and removes them when it falls, between a minimum and a maximum count.
  • New instances take a few minutes to start and warm up, so automatic scaling lags a sudden spike.
  • The plan's instance type can be covered by a reservation in its region (Part 8), or by a savings plan for compute, which also covers App Service.

Check it. Each constraint is a rule from an earlier part or from the service's documentation, not an opinion. The first sets a floor of two instances that will run no matter what, which is exactly the amount Part 8 says is safe to commit to. The third is the honest cost of automatic scaling: it reacts, it does not predict.

Options considered

OptionInstances billed on averageYearly cost (illustrative)Commitment
Keep a fixed 44≈ USD 14,000none
Fixed 33≈ USD 10,500none
Autoscale 2 to 5≈ 2.3≈ USD 8,100none
Autoscale 2 to 5, reserve the 2-instance floor2 reserved + ≈ 0.3 at normal rate≈ USD 5,6001 year, 2 instances
Autoscale 2 to 5, savings plan for compute≈ 2.3, partly discountedbetween the two above1 year, a spend per hour
  • Fixed 3 sounds like a cheap, simple saving, but it still pays for an idle instance most hours and would struggle at the newsletter peak.
  • Autoscale follows the load: about 2.3 instances on average, because most hours need the minimum of 2.
  • Reserving the floor discounts the 2 instances that always run, and leaves the occasional extra instance at the normal rate.
  • A savings plan would be more flexible (it also follows the team's other compute), but gives a smaller discount on a workload this predictable.

Check it. Recompute each row. Autoscale: 2.3 × 0.40 × 8,760 ≈ 8,100. With an illustrative 35% reservation discount, the floor costs 2 × 0.26 × 8,760 ≈ 4,550, and the extra 0.3 instance at the normal rate adds 0.3 × 0.40 × 8,760 ≈ 1,050, for about 5,600 in total. Then look at the shape: the biggest saving (14,000 to 8,100) comes from right-sizing, which needs no commitment and can be undone with one setting. The commitment takes a further, smaller slice. That is the ordering Part 8 recommends, and a proposal that leads with the commitment instead is worth questioning.

Decision

  1. Turn on autoscale with a minimum of 2 and a maximum of 5 instances, scaling out on sustained high CPU and in when it drops.
  2. Observe the real instance count for a full month, including a few newsletter peaks.
  3. If the floor really is 2 instances around the clock, buy a reservation for 2 instances, scoped to the API's resource group, paid monthly.

Check it. The commitment comes last, after measuring at the new configuration, because it is the only step that is hard to undo (Part 8). The reservation quantity equals the minimum instance count, the amount that runs every hour, so its utilization should stay near 100%. The scope keeps the discount on the workload it was bought for.

Consequences

Easier: the bill drops by roughly 60% and follows actual traffic; the newsletter peak gets up to 5 instances instead of being capped at 4.

Harder: the API must be safe to run on a changing number of instances. Nothing important may live in one instance's memory, because scale-in removes instances (Part 1: scaling out needs stateless instances). Autoscale rules need tuning and monitoring, and the first minutes of a sudden spike will be slower than before, while new instances start.

To revisit: the reservation size at renewal, or sooner if the floor grows.

Check it. A trustworthy consequences section always has a "harder" list. If a proposal lists only benefits, its costs have usually moved somewhere it does not mention: into the code, the monitoring, or someone's on-call rota.

Rollout and rollback

Autoscale is a setting on the plan, so it is easy to undo before any money is committed:

bash
# Turn on autoscale: between 2 and 5 instances, starting at 2
az monitor autoscale create --resource-group rg-photodrop-prod \
  --resource asp-photodrop-api --resource-type Microsoft.Web/serverfarms \
  --name autoscale-photodrop-api --min-count 2 --max-count 5 --count 2
 
# Add an instance when average CPU stays above 70% for 10 minutes
az monitor autoscale rule create --resource-group rg-photodrop-prod \
  --autoscale-name autoscale-photodrop-api --condition "CpuPercentage > 70 avg 10m" --scale out 1
 
# Rollback: turn autoscale off and go back to a fixed 4 instances
az monitor autoscale update --resource-group rg-photodrop-prod \
  --name autoscale-photodrop-api --enabled false
az appservice plan update --resource-group rg-photodrop-prod \
  --name asp-photodrop-api --number-of-workers 4

Once the reservation is bought, rolling back to a fixed size still works, but the reservation keeps costing money either way, so the rollback plan changes from "flip a setting" to "use an exchange, within Microsoft's rules" (Part 8).

Check it. Every step before the purchase is reversible with a control-plane change (Part 4). The proposal says plainly where that stops being true. Look for that sentence in any real proposal: the point after which undoing the decision costs money.


A checklist for any cost proposal

The same questions apply whatever the service:

  1. Is the current cost measured? A period, a source (cost data, usage metrics) and a number, not an estimate.
  2. Is the cost explained by the billing rule? Allocated or consumed; which meter; which formula (Parts 6 and 7).
  3. Are all copies counted? Instances, replicas, standby nodes: each running copy has its own meter (Part 6).
  4. Is sizing based on percentiles? Not on the average, and not on the single busiest moment (Part 7).
  5. Is the free, reversible saving separated from the committed one? Right-size first, commit second (Part 8).
  6. Does the commitment match the floor? Quantity, scope and term should match what runs every hour, with a plan for usage above it (Part 8).
  7. Are the operational costs listed? Scaling rules, monitoring, code changes, on-call (Part 7).
  8. Is the irreversible step last, with a rollback until then?

Glossary of cost terms

TermMeaningPart
meterone measured quantity of a resource, billed at a unit price6
vCore, vCore-houra unit of compute; one vCore for one hour6
retail / effective pricethe public list price / what you actually pay after discounts6
Retail Prices APIpublic API returning list prices by meter, region and currency6
allocated / consumedbilled for existing / billed for use6
replica, instancea running copy, each billed for its own compute6, 7
provisioned computea fixed size, billed every hour7
serverless computeauto-scaling between a minimum and maximum, billed per second for what the formula measures7
auto-pausea serverless resource stopping compute charges when idle7
p50 / p90 / p99the usage level that 50% / 90% / 99% of hours stayed at or below7
autoscalerules that add and remove instances automatically, between a minimum and maximum7, 9
transient errora short-lived failure, such as a dropped connection, fixed by retrying7
idempotentsafe to run more than once with the same result7
reservationa 1- or 3-year pre-purchase of a specific resource quantity, applied hourly, use it or lose it8
scopewhere a commitment's discount may land: resource group, subscription, management group or shared8
utilizationthe share of committed capacity actually used8
exchange / refundswapping a reservation for another / cancelling it, within published limits8
savings plana 1- or 3-year commitment to spend a fixed amount per hour across eligible services8
Azure Hybrid Benefitusing licences you already own to remove the licence part of a price8
ADRArchitecture Decision Record: a short document recording one decision and its reasons9

The one idea to hold onto

A cost proposal is a chain of claims, and each link can be checked: a measured cost, explained by a billing rule, with every copy counted, sized from percentiles, saving first through right-sizing (free and reversible) and only then through a commitment sized to the floor, with its operational costs listed honestly and its one irreversible step last. Recompute the numbers, match each argument to the rule behind it, and find the point after which undoing the decision costs money.

Further reading

What comes next

That completes the money side of the fundamentals. Part 10 steps back to look at the whole catalogue: Azure's couple of hundred services sorted into a handful of categories, each with a rule for when to reach for it, and the rest of this path placed on that map.