Skip to content

Add Advisor service retirement insights - #3891

Open
rashika1809 wants to merge 1 commit into
microsoft:mainfrom
rashika1809:advisor-service-retirement-insights
Open

rashika1809 wants to merge 1 commit into
microsoft:mainfrom
rashika1809:advisor-service-retirement-insights

Conversation

@rashika1809

Copy link
Copy Markdown

What does this PR do?

Adds the advisor_serviceretirement_insights command for querying Azure Advisor service-retirement burndown insights at subscription, service-group, or fleet scope.

The command queries microsoft.advisor/insights through Azure Resource Graph, maps the nested insight properties into an AOT-safe response model, and returns Day 1 versus current impacted-resource counts. It supports natural-language scenarios for exposure changes, backlog ranking, sub-50-percent burndown, and completed burndown.

This PR also adds command registration, consolidated-tool routing, command documentation, end-to-end prompts, a changelog entry, and comprehensive command/query/model tests.

GitHub issue number?

N/A

Validation

  • dotnet build tools\Azure.Mcp.Tools.Advisor\src\Azure.Mcp.Tools.Advisor.csproj --disable-build-servers — passed with 0 warnings and 0 errors
  • Focused Service Retirement Insights tests — 26 passed
  • Complete Advisor test suite — 401 passed
  • Local live ARG tests — fleet-wide and service-group-scoped requests returned expected data
  • Vally natural-language routing evaluation — passed and called advisor_serviceretirement_insights
  • git diff --check — passed
  • Azure MCP package README validation — passed
  • Update-AzCommandsMetadata.ps1 — completed successfully
  • Build-Local.ps1 -VerifyNpx — compilation and packaging completed; final shared npx-cache cleanup was blocked by a Windows EPERM lock on dpapi.node
  • Spelling command could not execute because the environment has Node 22.17.0 while the current cspell package requires Node 22.18.0 or later
  • ToolDescriptionEvaluator could not run because AOAI_ENDPOINT is not configured in this environment; Vally independently validated tool routing for the new prompt

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages
    • Added comprehensive tests for new functionality
    • Created a changelog entry
  • For MCP tool changes:
    • One tool per PR
    • Updated Azure MCP Server README documentation
    • Validated README changes with Process-PackageReadMe.ps1 -Command validate-all
    • ToolDescriptionEvaluator score of 0.4 or more — blocked because AOAI_ENDPOINT is unavailable; Vally routing evaluation passed
    • Updated consolidated-tools.json
  • Extra steps for Azure MCP Server tool changes:
    • Updated servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran Update-AzCommandsMetadata.ps1
    • Updated servers/Azure.Mcp.Server/docs/e2eTestPrompts.md

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access 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.

Add tenant-wide ARG-backed burndown insights for subscriptions and service groups, including typed KPI mapping, documentation, routing metadata, and comprehensive tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution rashika1809! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Tenant selection can silently query the wrong tenant, and required recorded-test and description-evaluation evidence remains missing.

5 open findings
What changed in this PR

Adds an Azure Advisor command for querying service-retirement burndown insights across subscriptions, service groups, and fleet scope.

Changes:

  • Adds the command, Resource Graph query, response model, and registration.
  • Adds unit tests, documentation, prompts, routing, and changelog entry.
  • Includes AOT serialization metadata.
File Description
ServiceRetirementInsightsServiceTests.cs Tests query construction and response parsing.
ServiceRetirementInsightsCommandTests.cs Tests command validation and execution.
IAdvisorService.cs Adds the insights service contract.
AdvisorService.cs Queries and maps Resource Graph insights.
ServiceRetirementInsightsOptions.cs Defines scope and result-limit options.
ServiceRetirementInsight.cs Defines the response model.
ServiceRetirementInsightsCommand.cs Implements the MCP command.
AdvisorJsonContext.cs Registers AOT serialization types.
AdvisorSetup.cs Registers the new command.
consolidated-tools.json Adds consolidated routing.
README.md Documents Advisor retirement scenarios.
e2eTestPrompts.md Adds routing prompts.
azmcp-commands.md Documents command syntax.
rashika-advisor-service-retirement-insights.yml Adds the feature changelog entry.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

ArgumentOutOfRangeException.ThrowIfLessThan(top, 1);
ArgumentOutOfRangeException.ThrowIfGreaterThan(top, 100);

var tenantResource = await GetTenantResourceAsync(cancellationToken);
Comment on lines +17 to +18
public class ServiceRetirementInsightsCommandTests
: CommandUnitTestsBase<ServiceRetirementInsightsCommand, IAdvisorService>
[--sub-category <sub-category>] \
[--retirement-date <eq|lt|le|gt|ge>:<yyyy-MM-dd>] \
[--top <1-100>] \
[--top <1-100>]
Comment on lines +136 to +139
| advisor_serviceretirement_insights | Summarize Day 1 exposure, current exposure, and highest-risk retirements for subscription <subscription> | none |
| advisor_serviceretirement_insights | Summarize Day 1 exposure, current exposure, and highest-risk retirements for service group <service-group> | none |
| advisor_serviceretirement_insights | Flag retirements that represent more than half of the current impacted resources remaining for subscription <subscription> | none |
| advisor_serviceretirement_insights | Flag retirements that represent more than half of the current impacted resources remaining for service group <service-group> | none |
Id = "938192ed-a9e5-4edf-b00d-cdec358e7b39",
Name = "insights",
Title = "Get Service Retirement Insights",
Description = "Get Azure service-retirement burndown insight at subscription or service-group aggregation levels. " +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants