Cost governance · Updated June 2026

Azure Cost Anomaly Detection: Catch Spend Spikes Before They Compound

By the CloudFinOpsKit team. 8 min read.

The most expensive cloud cost mistakes aren't the ones you plan — they're the ones you don't notice for three weeks. A reservation quietly expires, a test environment gets left running, a logging change 10×'s your ingestion. Each starts small and compounds daily until it shows up on a month-end invoice that's thousands higher than expected. Anomaly detection is the governance practice that catches these within days instead of at the bill. Here's how to do it in Azure — built-in and beyond.

Use the built-in detector first

Azure Cost Management has anomaly detection built in for subscriptions. It models your normal daily usage-cost pattern and flags days that deviate from it, shown directly in Cost analysis (the smart "anomaly" insights on the subscription view). It costs nothing and needs no setup to view.

The piece most teams miss is the alert: create an anomaly alert rule so Cost Management emails you when it detects an unusual pattern — you stop having to remember to look. Set it up in Cost Management → Cost alerts → Anomaly alerts, with the recipients who can actually act.

The two comparisons that catch the most

Beyond the built-in detector, two simple comparisons catch the majority of real problems:

Pick a threshold you can explain

It's tempting to get clever with statistics — flag anything beyond two standard deviations of the trend. We tried it and moved away from it: on a volatile estate, an adaptive band inflates its own baseline and quietly hides a genuine 25–30% swing. A fixed, explainable threshold works better in practice: flag any month whose effective spend moved more than ~20% versus the prior month. It's trivial to explain to finance ("we flag any 20%+ move"), and it never masks a real spike behind clever maths. Tune the percentage to your tolerance, but keep the rule legible.

Anomalies, built into your monthly report. The CloudFinOpsKit Tool saves a snapshot each run, so its report includes a Trends & Forecast band that flags any month whose spend moved more than 20% versus the prior month — telling you whether to investigate a spike or confirm a drop — alongside a next-month forecast. Its daily-spend analysis also flags days above 2× the period's daily average. You get anomaly detection as part of the cost review, not a separate tool to wire up.

The usual suspects behind a spike

When an alert fires, this checklist localizes the cause fast:

CauseTell-tale sign
Reservation / Savings Plan expiredCompute cost jumps with no new resources — rates reverted to on-demand. See RIs vs Savings Plans.
New or scaled-up workloadA specific resource group or service category rises; usually expected, but confirm it was intended.
Data egress / inter-region transferNetworking charges climb; often a new cross-region dependency or a backup misconfiguration.
Log / data ingestion blow-outLog Analytics or App Insights spikes — a verbose diagnostic setting or 100% sampling change.
Autoscale that didn't scale backCompute stays elevated after a peak; a scale-in rule is missing or broken.
Non-prod left runningDev/test resources without auto-shutdown running through nights and weekends.
One-time reservation purchaseA big one-off on the actual-cost view — not real waste, just amortization. View amortized to confirm.

Route the alert to someone who can act

An anomaly alert that lands in a shared inbox nobody owns is just noise. The governance value comes from routing: the alert should reach the owner of the affected scope — which is exactly what your allocation tags enable. Scope alert rules per subscription or team where you can, attach an action group with the right recipients, and make "investigate cost anomalies" an explicit step in the monthly cost review so nothing falls through.

Automate it across your whole estate (with math you can audit)

The built-in detector has real limits: it works at subscription scope only, its sensitivity can't be tuned, alerts are email-only, and it never explains why it flagged a day. The CloudFinOpsKit assessment tool now ships a Cost Anomaly Watch module that closes those gaps — and because it's deterministic statistics rather than a black-box model, every flag can be recomputed by hand.

Each run pulls ~3 months of daily cost per service per subscription (usage charges only, so an RI purchase never fakes a spike; the trailing two unfinalized days are excluded) and runs eight detectors: same-weekday spike detection (median + MAD, modified z-score ≥ 3.5), 7-vs-21-day step changes, Theil–Sen slow creep (the class the native tools miss — log growth, snapshot sprawl), new spend sources (the compromised-key detector), vanished spend, and three AI-specific detectors — token spikes, output-token bloat, and blended $/1K-token rate shifts that catch a quiet switch to a pricier model.

Every anomaly comes with expected vs actual figures, projected monthly impact, the top contributing resources on the anomaly day, and a plausible-cause hint. Schedule the tool daily and pass a Teams or Slack webhook, and High-severity anomalies message your channel automatically — a self-hosted early-warning system with thresholds you control. Keep the native alert enabled too; they complement each other.

FAQ

How fast can Azure detect a cost anomaly?

The built-in detector works on daily usage cost, so an anomaly typically surfaces within a day or two of the spend occurring — far ahead of the month-end invoice. Daily-average checks give you a similar early signal.

Will anomaly detection catch an expiring reservation?

Yes, indirectly — when a reservation lapses, effective compute cost jumps, which trips both the daily and month-over-month checks. Tracking commitment expiry dates proactively is better, but anomaly detection is the safety net.

Is a cost drop an anomaly too?

Worth flagging, yes. A sudden drop is usually good (your optimization landing) but can also signal a billing-data gap or a resource that stopped emitting cost unexpectedly — so confirm the cause rather than assuming a win.

Related reading: cross-cloud anomaly detection — one methodology for Azure and AWS · detecting AI cost anomalies (token spikes, model-mix shifts, idle PTUs) · the cloud cost governance framework · RIs vs Savings Plans (and expiry traps) · the 2026 cost optimization checklist