Add commitment discount eligibility open data set#2056
Merged
RolandKrummenacher merged 7 commits intodevfrom Mar 25, 2026
Merged
Add commitment discount eligibility open data set#2056RolandKrummenacher merged 7 commits intodevfrom
RolandKrummenacher merged 7 commits intodevfrom
Conversation
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 <[email protected]>
…ty data These columns are already present in the cost/prices data that this CSV will be joined against. Removing them reduces file size and keeps the dataset focused on what it uniquely provides: the eligibility flags. Co-Authored-By: Claude Opus 4.6 <[email protected]>
flanakin
approved these changes
Mar 24, 2026
- Change schedule from monthly to weekly (every Monday) - Add [Open Data] prefix to auto-PR title - Rename columns to FOCUS-aligned x_CommitmentDiscountSpendEligibility and x_CommitmentDiscountUsageEligibility with Eligible/Not Eligible values - Update PR body text from monthly to weekly Co-Authored-By: Claude Opus 4.6 <[email protected]>
flanakin
reviewed
Mar 24, 2026
Collaborator
flanakin
left a comment
There was a problem hiding this comment.
🤖 [AI][Claude] PR Review
Summary: Solid addition of a pre-computed commitment discount eligibility dataset that will improve Hub query performance. The script and workflow are well-structured, but there are a few issues to address around workflow formatting, error handling, documentation, and scalability.
🚫 Blockers (1)
- Workflow PR body will have leading whitespace due to heredoc indentation
⚠️ Should fix (2)
- Retry logic doesn't differentiate error types or respect
Retry-Afterheaders src/open-data/README.mdnot updated with the new dataset — please add a section for CommitmentDiscountEligibility following the same format as the existing datasets (PricingUnits, Regions, ResourceTypes, Services)
💡 Suggestions (2)
- Workflow should handle existing branches/PRs to avoid conflicts on repeated runs
Build-OpenData.ps1auto-generates PowerShell functions from all CSVs insrc/open-data/. With 84K rows, the generated file will be ~4MB. See #2069 for tracking this concern.
flanakin
requested changes
Mar 24, 2026
- Fix heredoc indentation: move PR body to env var with YAML block scalar - Include day in branch name for weekly runs (YYYYmmdd) - Improve retry logic: fail fast on 4xx (except 429), respect Retry-After header, show accurate error reason in log messages - Regenerate CSV with FOCUS-aligned column names Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
|
|
flanakin
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withsavingsPlanarrays), 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
MeterIdReservationEligibleSavingsPlanEligibleScope
Reservationin the API and are includedNext steps
Build-OpenData.ps1to generate PowerShell functions and KQL lookup tablesTest plan
🤖 Generated with Claude Code