microsoft / microsoft/finops-toolkit

SavingsPlan workbook queries exceed ARG's documented 3-join limit

Open
#2,227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Skill: KQL Tool: Workbooks Type: Cleanup
Dominant language
PowerShell
Stars
603
Forks
249
Avg merge
7d 11h
Merged PRs (30d)
11

Description

🛠️ Problem

The two queries in src/workbooks/optimization/SavingsPlan/SavingsPlan.workbook ("Savings plan Summary" and "Savings plan details") each contain 4 join operators, above Azure Resource Graph's documented limit of 3 joins per query:

  1. join on advisor suppressions (on stableId)
  2. join on advisor configurations, subscription level (on subscriptionId)
  3. join on advisor configurations, resource group level (on subscriptionId, resourceGroup)
  4. join kind=inner on resourcecontainers — only to fetch the subscription display name

ARG currently executes the queries without error (verified during PR #2225 testing), so this is a latent risk rather than an active failure: if the documented limit starts being enforced, both tiles break.

💡 Suggested fix

Drop join #4 and render the subscription name via a workbook column formatter / parameter instead — this is exactly why the equivalent Reservations queries (Reservations.workbook, commitment.workbook) stay at 3 joins. That also removes the join that had the innerunique data-loss bug fixed in PR #2225.

ℹ️ Additional context

  • 19 other workbook queries sit exactly at the 3-join ceiling (no headroom for future joins); only these two exceed it.
  • Related: PR #2225 (repo-wide join/lookup review) fixed the bare-join data loss in these same queries but intentionally did not restructure them.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open src/workbooks/optimization/SavingsPlan/SavingsPlan.workbook and inspect the “Savings plan Summary” and “Savings plan details” queries. Compare their subscription-name handling with Reservations.workbook and commitment.workbook, and review PR #2225 for context. Done means both queries stay within three joins while still displaying the subscription name.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.