Blog Post

FinOps Blog
6 MIN READ

Right‑sizing Azure Savings Plans, one hour at a time

Dirk_Brinkmann's avatar
Jun 11, 2026

Most of us have, at some point, sized a commitment the same way we order food for a team offsite: estimate, round up, and hope nobody complains. It works for pizza. It is a less robust strategy for a three‑year Savings Plan.

Azure Cost Management already produces commitment recommendations for you, and they are a great starting point. But the headline dollar figure on the portal hides the most useful signal a FinOps team can get its hands on: the hourly Pay‑As‑You‑Go (PAYG) usage that the recommendation engine actually looked at. Once you have that signal in a spreadsheet, "right‑sized" stops being a vibe and starts being a number you can defend in a steering meeting.

This post walks through how to pull that data out of the Cost Management REST API, and shares a small companion PowerShell script that does the heavy lifting and produces analyst‑friendly CSV and Markdown outputs.

Why a single recommended number isn't enough

A Savings Plan recommendation is, at its core, an optimisation against a distribution of hourly compute spend over a lookback window. The portal typically surfaces the single commitment level that maximises savings under a "reasonable utilisation" assumption. That's a sensible default, but it answers only one question.

The questions FinOps practitioners also want to answer include:

  • What does my PAYG demand actually look like hour‑by‑hour? Smooth and predictable, or spiky and seasonal?
  • How does coverage and savings change if I commit a bit less, or a bit more?
  • Will the recommended commitment leave me with wastage on weekends or overnight?
  • Can I correlate the hourly profile with maintenance windows, batch jobs, or business hours?

You cannot answer those questions with a single dollar figure. You can answer all of them with the hourly series and the alternative commitment levels — and the API exposes both.

What the Benefit Recommendations API gives you

The endpoint is the Benefit Recommendations - List operation (api-version=2025-03-01). Pointed at any of the supported scopes — Billing Account (EA), Billing Profile (MCA), Subscription, or Resource Group — it returns one or more recommendations for the chosen lookBackPeriod (Last7Days, Last30Days, Last60Days) and term (P1Y, P3Y).

The two $expand options are where the magic lives:

  • $expand=properties/allRecommendationDetails returns an array of alternative commitment levels (AllSavingsBenefitDetails). Each entry includes commitmentAmount, coveragePercentage, benefitCost, overageCost, savingsAmount, savingsPercentage, wastageCost, and averageUtilizationPercentage.
  • $expand=properties/usage returns the hourly PAYG charge series (usage.charges) that the engine used. Combined with properties.firstConsumptionDate and properties.lastConsumptionDate, you get a complete time‑aligned view of demand.

Both expansions are cheap and worth requesting every time. They turn a single recommendation into a small, complete data product.

Meet the script: Export-BenefitRecommendations.ps1

To make this useful in five minutes rather than an afternoon, there is a PowerShell script on GitHub that wraps the API call and produces ready‑to‑use artifacts. It is interactive, so there is nothing to memorise:

 
=== Azure Benefit Recommendations Export ===

Select billing scope kind:
  * [1] Billing Account (EA)
    [2] Billing Profile (MCA)
    [3] Subscription
    [4] Resource Group
Enter choice 1-4 (default 1): 1
Billing Account ID: <your-EA-billing-account-id>

Select lookback period:
    [1] Last7Days
  * [2] Last30Days
    [3] Last60Days
Enter choice 1-3 (default 2): 3

Select term:
  * [1] P1Y
    [2] P3Y
Enter choice 1-2 (default 1): 2
...
Retrieved 1 recommendation(s).

It authenticates via the Az.Accounts module, always requests both $expand options, follows nextLink pagination, verifies API access up front (translating 401/403/404 into actionable hints), and writes four files using a predictable name pattern:

  • yyyy-MM-dd-<scope>-<lookback>-<term>-AllRecommendationDetails.csv — one row per commitment alternative, ready for pivot tables.
  • yyyy-MM-dd-<scope>-<lookback>-<term>-TopRecommendation.md — a Markdown brief on the top recommendation, including the recommended commitment row and the full alternatives table.
  • yyyy-MM-dd-<scope>-<lookback>-<term>-HourlyUsage.csv — hour‑by‑hour PAYG usage for the top recommendation, aligned to the API's actual data window (no padding, no trailing blanks).
  • yyyy-MM-dd-<scope>-<lookback>-<term>-Raw.json — optional full response dump, for archival or downstream tooling.

The naming convention is intentional: paste a folder of these into Power BI and the dates, scopes, and terms are already in the filename.

A worked example

Here is a real shape from a sample Last60Days / P3Y export against an EA billing account. The AllRecommendationDetails CSV gives us four commitment alternatives:

averageUtilizationPercentage,coveragePercentage,commitmentAmount,overageCost,benefitCost,savingsAmount,savingsPercentage,totalCost,wastageCost
100.000,28.868,4.124,30914.280,5889.072,6656.889,15.317,36803.352,0.000 100.000,39.168,5.848,26437.791,8350.944,8671.506,19.953,34788.735,0.000
9.984,97.883,16.359,919.948,23360.652,19179.641,44.131,24280.600,3.767 98.684,98.900,16.806,477.956,23998.968,18983.317,43.680,24476.924,315.907

Read those rows like an interactive lever:

  • Commit $4.124/hr → 28.9% coverage, 15.3% savings, zero wastage. Safe, but most of your spend is still PAYG.
  • Commit $5.848/hr → 39.2% coverage, 19.9% savings. Still safe, still conservative.
  • Commit $16.359/hr → 97.9% coverage, 44.1% savings, ~$3.77 of wastage. This is the sweet spot the engine flags as recommended.
  • Commit $16.806/hr → 98.9% coverage, 43.7% savings, but wastage jumps to $315.9 over the window. You bought more coverage and the engine charged you for it.

The hourly CSV is what makes the recommendation defensible. It contains 1,428 rows — one per hour from 2026-04-11T00:00 through 2026-06-09T11:00 (the API's reported data range, not "now minus 60 days"):

DateTime,HourlyPayGoUsage
2026-04-11T00:00,29.5350191832771
2026-04-11T01:00,29.566694701744
...
2026-06-09T11:00,32.7312920192344

Drop that into Excel or Power BI, lay a horizontal line at the recommended commitmentAmount ($16.359/hr), and you immediately see how often demand sits above the line (covered by PAYG overage) versus below it (where the commitment is technically idle but, given the savings rate, still net‑positive). You can also slice by hour‑of‑day to spot weekend troughs or batch‑job spikes that change how you interpret "average utilisation."

Try it yourself

The script and full documentation live at github.com/DirkBrinkmann/azure-savingsplan-insights. Quickstart:

git clone https://github.com/DirkBrinkmann/azure-savingsplan-insights.git 
cd azure-savingsplan-insights 
Install-Module Az.Accounts -Scope CurrentUser  # if you don't already have it 

#Connect to Azure
Connect-AzAccount
#Run the script 
.\Export-BenefitRecommendations.ps1

You will need read permission on the scope you target — Cost Management Reader on a subscription, or Billing Reader at the billing account / billing profile level, is enough.

Give it a spin against your own scope and tell us how it goes. The repo at github.com/DirkBrinkmann/azure-savingsplan-insights has Issues and Discussions enabled — bug reports, edge cases ("my response shape looks different"), feature ideas, and "I plotted this in Power BI and learned X" stories are all welcome. The script will only get better with real‑world data behind it, and yours is the kind we want to hear about.

Closing nudge

In FinOps terms, this is squarely an Inform phase activity: turning a black‑box recommendation into a transparent dataset your team can challenge, chart, and align on. The API has had this data all along; the script just makes it boring to extract — which is exactly what you want a FinOps tool to be.

Pull a Last60Days / P3Y export for your top‑spending scope, plot the hourly line, and decide your next Savings Plan with a number you can point to. Your future self (and your finance partner) will thank you.

Published Jun 11, 2026
Version 1.0

2 Comments