Repository navigation
Read Advisor cost recommendations from the REST API and list only the 30-day look-back variant - #426
Merged
Claudio Merola (Claudio-Merola) merged 3 commits intoNov 18, 2026
Conversation
…ce Graph Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… subscription Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dations Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claudio Merola (Claudio-Merola)
approved these changes
Nov 18, 2026
Claudio Merola (Claudio-Merola)
left a comment
Collaborator
There was a problem hiding this comment.
LGTM
Claudio Merola (Claudio-Merola)
merged commit Nov 18, 2026
7ca943c
into
microsoft:main
1 check passed
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.
Problem
The Advisor sheet does not match the Azure portal for cost recommendations:
advisorresources, which keeps recommendations Advisor has already retired, for months. Reservation recommendations for VMs that were since covered by a purchase keep showing up. Resource Graph also leaves outannualSavingsAmounton unattached-disk recommendations. The portal reads the Advisor REST API, which has neither problem.Change
Get-ARIAPIResourcesalso readsMicrosoft.Advisor/recommendations?$filter=Category eq 'Cost'(api-version 2023-01-01) per subscription, followingnextLink, filtered to Medium/High impact like the Resource Graph query. Not requested with-SkipAdvisory.Merge-ARIAdvisorCost: for each subscription whose REST read fully succeeded, replaces its Resource Graph Cost rows with the REST rows (honouring-ResourceGroup). If the call or any page fails, that subscription keeps its Resource Graph rows. With-SkipAPIsnothing changes.Start-ARIAdvisoryJobkeeps only the 30-day look-back variant per recommendation (the shortest one when no 30-day variant exists). Both the 1-year and 3-year terms are kept. Recommendations without a look-back are unchanged.docs/features/azure-advisor.mddescribes both.Verification
Live run against a production subscription, plus a full
Invoke-ARIrun (no errors):Unattached-disk rows now carry their annual savings. Ad-hoc tests also covered the merge (one subscription read, one failed,
-ResourceGroup, empty input) and the look-back grouping (7/30/60 × P1Y/P3Y → 2 rows; 7/60 only → the 7-day row; no look-back → kept).nextLinkpaging was not exercised live (the test subscription returned one page).🤖 Generated with Claude Code
Microsoft Reviewers: Open in CodeFlow