Skip to content

fix the broken Azure Monitor Health Model tool and update health model integration to a minimal working version#2979

Open
abossard wants to merge 5 commits into
microsoft:mainfrom
abossard:healthmodel-breakfix-update
Open

fix the broken Azure Monitor Health Model tool and update health model integration to a minimal working version#2979
abossard wants to merge 5 commits into
microsoft:mainfrom
abossard:healthmodel-breakfix-update

Conversation

@abossard

@abossard abossard commented Jun 30, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes the broken and outdated health model functionality by removing it and replacing it with the latest health model preview API

This will allow to list and see details of the health models in a subscription.

Azure Monitor Health Models

GitHub issue number?

#2247

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Signed-off-by: Andre Bossard <anbossar@microsoft.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

@abossard abossard changed the title updated health model integration to a minimal working version fix the broken Azure Monitor Health Model tool and update health model integration to a minimal working version Jun 30, 2026
@jairmyree

Copy link
Copy Markdown
Member

/azp run mcp - pullrequest - live

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

abossard added 2 commits July 1, 2026 13:02
Signed-off-by: Andre Bossard <anbossar@microsoft.com>
Signed-off-by: Andre Bossard <anbossar@microsoft.com>
@abossard abossard marked this pull request as ready for review July 1, 2026 11:38
Copilot AI review requested due to automatic review settings July 1, 2026 11:38

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.

Pull request overview

This PR modernizes the Azure Monitor Health Models integration by removing the broken entity-health dataplane command and replacing it with minimal working control-plane commands backed by the Microsoft.CloudHealth/healthmodels ARM surface (via Azure.ResourceManager.CloudHealth). It updates the Azure MCP Server’s tool inventory and docs accordingly, and adds unit coverage for the new commands.

Changes:

  • Replaced monitor healthmodels entity get with monitor healthmodels list and monitor healthmodels get (new commands + options + models).
  • Reimplemented IMonitorHealthModelService to list/get health models using the CloudHealth ARM SDK and added JSON source-gen registrations.
  • Updated docs/tool metadata (README, consolidated tools, azmcp-commands, e2e prompts, ToolDescriptionEvaluator prompts) and added changelog entry + spelling dictionary update.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelListCommandTests.cs Adds unit tests for the new healthmodels list command response shape and option forwarding.
tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelGetCommandTests.cs Adds unit tests for the new healthmodels get command response contract.
tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/Entity/EntityGetHealthCommandTests.cs Removes tests for the deprecated/removed entity-health command.
tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs Replaces dataplane token+HTTP logic with CloudHealth ARM SDK list/get implementations and projections.
tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorHealthModelService.cs Updates service contract to ListHealthModels and GetHealthModel returning typed models.
tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelListOptions.cs Introduces options for healthmodels list (subscription/resource-group/tenant/retry).
tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelGetOptions.cs Refactors options for healthmodels get (health-model + required resource-group).
tools/Azure.Mcp.Tools.Monitor/src/MonitorSetup.cs Registers new commands in DI and command tree under monitor healthmodels.
tools/Azure.Mcp.Tools.Monitor/src/Models/HealthModels/HealthModelSummary.cs Adds a lean summary DTO for listing results.
tools/Azure.Mcp.Tools.Monitor/src/Models/HealthModels/HealthModelIdentity.cs Adds DTO for managed identity projection.
tools/Azure.Mcp.Tools.Monitor/src/Models/HealthModels/HealthModelDetail.cs Adds detailed DTO extending summary with healthState/identity/tags.
tools/Azure.Mcp.Tools.Monitor/src/Commands/MonitorJsonContext.cs Registers new health model DTOs/results for source-generated JSON (AOT-friendly).
tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelListCommand.cs Adds the monitor healthmodels list command implementation.
tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelGetCommand.cs Adds the monitor healthmodels get command implementation.
tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/Entity/EntityGetHealthCommand.cs Removes the deprecated/removed entity-health command implementation.
tools/Azure.Mcp.Tools.Monitor/src/Azure.Mcp.Tools.Monitor.csproj Adds CloudHealth ARM SDK package reference.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Swaps tool identifiers from entity get to list/get for monitor healthmodels.
servers/Azure.Mcp.Server/README.md Updates example prompts to reflect new health model commands.
servers/Azure.Mcp.Server/KNOWN-ISSUES.md Removes known-issue entry for the removed healthmodels entity tool.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Updates e2e prompts for the new health model tools.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Updates CLI command documentation for health models.
servers/Azure.Mcp.Server/changelog-entries/1782800143580.yaml Adds changelog entry describing the tool replacement.
eng/tools/ToolDescriptionEvaluator/prompts/prompts.json Updates evaluator prompts for the renamed/replaced tools.
Directory.Packages.props Adds Azure.ResourceManager.CloudHealth version and bumps shared Azure SDK package versions.
.vscode/cspell.json Adds cloudhealth to spelling dictionary.

Comment thread tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs Outdated
Comment thread servers/Azure.Mcp.Server/README.md Outdated
abossard and others added 2 commits July 1, 2026 14:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andre Bossard <anbossar@microsoft.com>
@abossard

abossard commented Jul 2, 2026

Copy link
Copy Markdown
Author

ToolDescriptionEvaluator

Tool Prompt Rank Score
monitor_healthmodels_get "Show me the health model … in resource group …" 2 0.667
monitor_healthmodels_get "Get the Azure Monitor health model named …" 1 0.734
monitor_healthmodels_list "List … in my subscription" 1 0.802
monitor_healthmodels_list "What health models are in resource group …?" 1 0.666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants