Repository navigation
Add service group support to Advisor recommendation summaries - #3604
Closed
Ravi Gupta (ravigupta99) wants to merge 38 commits into
Closed
Ravi Gupta (ravigupta99) wants to merge 38 commits into
Ravi Gupta (ravigupta99) wants to merge 38 commits into
Conversation
…ecommendation-patch
…ecommendation-patch
…ecommendation-patch # Conflicts: # servers/Azure.Mcp.Server/docs/azmcp-commands.md # servers/Azure.Mcp.Server/docs/e2eTestPrompts.md # tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs # tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs # tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs # tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationDescription.cs # tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationProperties.cs # tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationListCommandTests.cs # tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Services/AdvisorServiceConversionTests.cs
…-patch' into guptaravi/advisor-sg-recommendation-patch # Conflicts: # tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs
…r-recommendation-summary # Conflicts: # servers/Azure.Mcp.Server/docs/azmcp-commands.md # tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs # tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationListOptions.cs # tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationSummaryOptions.cs # tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs # tools/Azure.Mcp.Tools.Advisor/src/Validation/RecommendationFilterValidator.cs # tools/Azure.Mcp.Tools.Advisor/src/Validation/ServiceRetirementFilterValidator.cs # tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Services/AdvisorServiceFilterBuilderTests.cs
…ecommendation-summary # Conflicts: # servers/Azure.Mcp.Server/README.md # servers/Azure.Mcp.Server/docs/azmcp-commands.md # servers/Azure.Mcp.Server/docs/e2eTestPrompts.md # servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json # tools/Azure.Mcp.Tools.Advisor/src/AdvisorSetup.cs # tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs
…g-recommendation-patch # Conflicts: # servers/Azure.Mcp.Server/README.md # servers/Azure.Mcp.Server/docs/azmcp-commands.md # servers/Azure.Mcp.Server/docs/e2eTestPrompts.md # servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json # tools/Azure.Mcp.Tools.Advisor/src/AdvisorSetup.cs # tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationUpdateCommand.cs # tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationUpdateOptions.cs # tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs # tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs # tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationUpdateCommandTests.cs # tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Services/AdvisorRecommendationUpdateServiceTests.cs
…ecommendation-summary # Conflicts: # servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json
…g-recommendation-patch # Conflicts: # servers/Azure.Mcp.Server/docs/e2eTestPrompts.md # tools/Azure.Mcp.Tools.Advisor/src/AdvisorSetup.cs
…ion-patch' into guptaravi/advisor-recommendation-summary # Conflicts: # servers/Azure.Mcp.Server/docs/e2eTestPrompts.md # tools/Azure.Mcp.Tools.Advisor/src/AdvisorSetup.cs # tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Ravi Gupta (ravigupta99)
marked this pull request as ready for review
September 23, 2026 07:00
Ravi Gupta (ravigupta99)
requested review from
Larry Osterman (LarryOsterman),
Rick Winter (RickWinter),
Alan Zimmer (alzimmermsft),
Connie Yau (conniey),
Vinay Gera (g2vinay),
Sandeep Sen (sandeep-sen) and
Steven Vukelich (vukelich)
and
a lite review from Copilot
September 23, 2026 07:00
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The unresolved AdvisorService API-version concern and pending reconciliation/live acceptance make safe automated approval inappropriate.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds Azure service-group scope support to Advisor recommendation summaries while preserving subscription behavior and sharing scope/query infrastructure with updates.
Changes:
- Adds service-group validation, tenant-scoped ARG queries, filtering, and routing.
- Extends models and shared command infrastructure.
- Updates tests, documentation, metadata, and changelog entries.
| File | Description |
|---|---|
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Services/RecommendationSummaryServiceTests.cs |
Tests service-group summaries and tenant scoping. |
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Services/RecommendationQueryBuilderTests.cs |
Tests service-group ARG predicates. |
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Services/AdvisorServiceConversionTests.cs |
Tests service-group property conversion. |
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Services/AdvisorRecommendationUpdateServiceTests.cs |
Tests subscription and service-group update requests. |
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationUpdateCommandTests.cs |
Tests update scope validation and routing. |
tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationSummaryCommandTests.cs |
Tests summary scope validation and routing. |
tools/Azure.Mcp.Tools.Advisor/src/Validation/RecommendationScopeValidator.cs |
Validates recommendation scopes. |
tools/Azure.Mcp.Tools.Advisor/src/Services/RecommendationSummaryService.cs |
Implements service-group summaries. |
tools/Azure.Mcp.Tools.Advisor/src/Services/RecommendationQueryScope.cs |
Defines query scopes. |
tools/Azure.Mcp.Tools.Advisor/src/Services/RecommendationQueryBuilder.cs |
Builds service-group predicates. |
tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationProperties.cs |
Parses serviceGroupId. |
tools/Azure.Mcp.Tools.Advisor/src/Services/IRecommendationSummaryService.cs |
Extends the summary service contract. |
tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs |
Extends the Advisor service contract. |
tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs |
Handles Advisor update and service-group requests. |
tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorResourceGraphQueryExecutor.cs |
Executes tenant-scoped ARG queries. |
tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationUpdateOptions.cs |
Adds service-group update options. |
tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationSummaryOptions.cs |
Adds service-group summary options. |
tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/IRecommendationScopeOptions.cs |
Defines shared scope options. |
tools/Azure.Mcp.Tools.Advisor/src/Models/RecommendationProperties.cs |
Exposes nullable serviceGroupId. |
tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationUpdateCommand.cs |
Routes updates by scope. |
tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationSummaryCommand.cs |
Routes summaries by scope. |
tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationScopeCommand.cs |
Shares scope processing and validation. |
tools/Azure.Mcp.Tools.Advisor/src/AdvisorSetup.cs |
Updates Advisor registrations and descriptions. |
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json |
Updates consolidated tool descriptions. |
servers/Azure.Mcp.Server/README.md |
Adds service-group usage examples. |
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md |
Adds service-group prompts. |
servers/Azure.Mcp.Server/docs/azmcp-commands.md |
Documents new scope options. |
servers/Azure.Mcp.Server/changelog-entries/guptaravi-advisor-service-group-recommendation-update.yml |
Records update scope support. |
servers/Azure.Mcp.Server/changelog-entries/guptaravi-advisor-recommendation-summary-service-group.yml |
Records summary scope support. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
17 tasks done
Member
Author
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.

What does this PR do?
Extends the existing
advisor recommendation summarytool from #3520 so the same MCP tool can summarize either subscription-scoped or Azure service-group-scoped Advisor recommendations.The unified summary tool:
--subscriptionor--service-groupand rejects requests that explicitly provide both.--resource-groupwith service-group scope instead of silently ignoring an ambiguous filter.properties.serviceGroupId =~ "/providers/Microsoft.Management/serviceGroups/{serviceGroup}".isempty(properties.serviceGroupId)population.{ key, label, count }response contract.serviceGroupIdto the shared recommendation properties model for update and future list reuse.The change also extracts the subscription-or-service-group binding and validation from the reviewed update implementation into
RecommendationScopeCommand<TOptions, TResult>. Both update and summary now share explicit option-presence handling, default-subscription resolution, mutual exclusion, and service-group ID validation. The update tool's behavior remains unchanged.Dependency and merge order
This PR is intentionally stacked on #3517, which has already completed team review.
upstream/main, resolve the squash/stack overlap, and verify that the remaining diff contains only the shared refactor and recommendation-summary SG changes.Current service-group data availability
Service-group-pivoted Advisor recommendations are not yet broadly available in ARG. Tenant discovery currently found one active 64-character recommendation under service group
commerce.That record was used for the available exact-binary validation. Broader multi-row, multi-subscription, filter-intersection, and lifecycle coverage will be rerun after the service-group recommendation rollout following September 15, 2026. A zero-row or single-row result is not considered the final live acceptance gate.
Validation completed
azmcp.exeservice-group matrix: 14/14 passed.0.424563–0.600615.advisor_recommendation_summaryand supplied theservice-groupargument.Build-Local.ps1 -VerifyNpxpassed; inner builds, packaging, cache cleanup, and Azure/Fabric/Template npm tool-list invocations completed without command failures.Build-Local.ps1 -IncludeNative. The inner Azure MCP native publish remains blocked by the pre-existing CosmosMicrosoft.Azure.Documents.JsonSerializableIL2026/IL3050/MSB3077 failure; no Advisor-specific native diagnostic was reported.copilot-fix-ai-search-consolidated-description.ymlentry using invalid sectionBug Fixes; the new entry uses validFeatures AddedandOther Changessections.Post-rollout live acceptance required before merge
After broader SG recommendations are indexed:
New.Public references
GitHub issue number?
Follow-up to #3520 and dependent on #3517.
Azure DevOps PBI: https://dev.azure.com/msazure/One/_workitems/edit/39592401
Pre-merge Checklist
advisor_recommendation_summary; update changes are a behavior-preserving shared refactorservers/Azure.Mcp.Server/README.mdProcess-PackageReadMe.ps10.4with top-three ranking for every summary promptconsolidated-tools.jsonservers/Azure.Mcp.Server/docs/azmcp-commands.mdUpdate-AzCommandsMetadata.ps1servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdupstream/mainInvoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with
writeaccess to the repo need to validate the contents of this PR before leaving a comment with the text/azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.