Skip to content

Add commitment discount eligibility open data set#2056

Open
RolandKrummenacher wants to merge 1 commit intodevfrom
feature/commitment-discount-eligibility-opendata
Open

Add commitment discount eligibility open data set#2056
RolandKrummenacher wants to merge 1 commit intodevfrom
feature/commitment-discount-eligibility-opendata

Conversation

@RolandKrummenacher
Copy link
Collaborator

Summary

Adds a new open data CSV (CommitmentDiscountEligibility.csv) listing Azure meters eligible for Reserved Instances and/or Savings Plans, sourced from the Azure Retail Prices API.

  • src/scripts/Update-CommitmentDiscountEligibility.ps1 — PowerShell script that pages through the Retail Prices API to collect RI-eligible meters (priceType eq 'Reservation') and SP-eligible meters (Consumption items with savingsPlan arrays), then merges them into a single CSV.
  • .github/workflows/opendata-commitment-eligibility.yml — GitHub Action that runs monthly (1st of each month) or on manual dispatch, executes the script, and creates a PR if data changed.
  • src/open-data/CommitmentDiscountEligibility.csv — Initial dataset with ~84K meters.

Motivation

FinOps Hub Prices_v1_2() / Prices_v1_0() functions currently compute commitment discount eligibility via cross-row lookups at query time, scanning the full prices table on every call. This open data set provides a pre-computed lookup that can replace those per-query scans, and also solves the per-batch ingestion issue described in #1625.

Schema

Column Description
MeterId Azure meter GUID (region-specific)
ServiceName Azure service name (informational)
ServiceFamily Service family (informational)
ReservationEligible Whether the meter has RI pricing
SavingsPlanEligible Whether the meter has SP pricing

Scope

  • Covers Reserved Instances and Savings Plans only
  • Pre-Purchase Plans (e.g., Databricks, Sentinel SCUs) show as Reservation in the API and are included
  • Commitment tiers (e.g., Sentinel GB/day, Log Analytics) are out of scope for now — they use a different pricing model

Next steps

  • Integrate into Build-OpenData.ps1 to generate PowerShell functions and KQL lookup tables
  • Use in Hub ingestion/view functions to replace cross-row eligibility computation

Test plan

  • Full test run completed — script fetched ~142 pages of RI data and ~609 pages of Consumption data
  • Rate limit retry logic validated (exponential backoff with up to 5 retries)
  • Output CSV verified: 84,612 unique meters, no duplicates
  • Review GitHub Action workflow triggers and PR creation logic
  • Validate a sample of meter IDs against the Azure Pricing Calculator

🤖 Generated with Claude Code

Add a new open data CSV listing Azure meters eligible for Reserved
Instances and/or Savings Plans, sourced from the Azure Retail Prices API.

- PowerShell script to fetch RI/SP eligibility from the public API
- GitHub Action to refresh the data monthly and create a PR
- Initial CSV with ~84K meters

This data can replace the per-query cross-row eligibility lookups in
FinOps Hub Prices functions, addressing the performance concern in #1625.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Review 👀 PR that is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants