Skip to content

Commit f43b47a

Browse files
abossardCopilot
andauthored
fix the broken Azure Monitor Health Model tool and update health model integration to a minimal working version (#2979)
* updated health model integration to a minimal working version Signed-off-by: Andre Bossard <anbossar@microsoft.com> * cleanup and smaller outputs to be more MCP conform Signed-off-by: Andre Bossard <anbossar@microsoft.com> * updated README Signed-off-by: Andre Bossard <anbossar@microsoft.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * better descriptions and null; check for UAMI Signed-off-by: Andre Bossard <anbossar@microsoft.com> * added live tests for the new health models stuff Signed-off-by: Andre Bossard <anbossar@microsoft.com> * Assert.All instead of foreach. Signed-off-by: Andre Bossard <anbossar@microsoft.com> --------- Signed-off-by: Andre Bossard <anbossar@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent e7d187b commit f43b47a

29 files changed

Lines changed: 731 additions & 519 deletions

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@
368368
"chilecentral",
369369
"cicd",
370370
"cloudarchitect",
371+
"cloudhealth",
371372
"codegen",
372373
"codeium",
373374
"codeowners",

Directory.Packages.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageVersion Include="Azure.AI.Agents.Persistent" Version="1.2.0-beta.4" />
1212
<PackageVersion Include="Azure.AI.OpenAI" Version="2.8.0-beta.1" />
1313
<PackageVersion Include="Azure.Bicep.Types" Version="0.6.50" />
14-
<PackageVersion Include="Azure.Core" Version="1.55.0" />
14+
<PackageVersion Include="Azure.Core" Version="1.58.0" />
1515
<PackageVersion Include="Azure.Data.AppConfiguration" Version="1.6.1" />
1616
<PackageVersion Include="Azure.Data.Tables" Version="12.11.0" />
1717
<PackageVersion Include="Azure.Identity" Version="1.21.0" />
@@ -25,6 +25,7 @@
2525
<PackageVersion Include="Azure.ResourceManager.ApplicationInsights" Version="1.1.0-beta.1" />
2626
<PackageVersion Include="Azure.ResourceManager.AppContainers" Version="1.4.1" />
2727
<PackageVersion Include="Azure.ResourceManager.AppService" Version="1.4.1" />
28+
<PackageVersion Include="Azure.ResourceManager.CloudHealth" Version="1.0.0-beta.3" />
2829
<PackageVersion Include="Azure.ResourceManager.ContainerInstance" Version="1.3.0-beta.3" />
2930
<PackageVersion Include="Azure.ResourceManager.Compute" Version="1.11.0" />
3031
<PackageVersion Include="Azure.ResourceManager.HDInsight" Version="1.2.0-beta.5" />
@@ -94,7 +95,7 @@
9495
<PackageVersion Include="Npgsql" Version="10.0.1" />
9596
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
9697
<PackageVersion Include="Yarp.ReverseProxy" Version="2.3.0" />
97-
<PackageVersion Include="System.ClientModel" Version="1.11.0" />
98+
<PackageVersion Include="System.ClientModel" Version="1.14.0" />
9899
<PackageVersion Include="System.CommandLine" Version="2.0.6" />
99100
<PackageVersion Include="System.Formats.Asn1" Version="10.0.6" />
100101
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.17.0" />

eng/tools/ToolDescriptionEvaluator/prompts/prompts.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,13 @@
548548
"monitor_activitylog_list": [
549549
"List the activity logs of the last month for <resource_name>"
550550
],
551-
"monitor_healthmodels_entity_get": [
552-
"Show me the health status of entity <entity_id> using the health model <health_model_name>"
551+
"monitor_healthmodels_get": [
552+
"Show me the health model <health_model_name> in resource group <resource_group>",
553+
"Get the Azure Monitor health model named <health_model_name>"
554+
],
555+
"monitor_healthmodels_list": [
556+
"List the Azure Monitor health models in my subscription",
557+
"What health models are in resource group <resource_group>?"
553558
],
554559
"monitor_metrics_definitions": [
555560
"Get metric definitions for <resource_type> <resource_name> from the namespace",

servers/Azure.Mcp.Server/KNOWN-ISSUES.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ The following tools are not supported when the Azure MCP Server is running in HT
1111

1212
| Namespace | Impacted Tools |
1313
|-----------|----------------|
14-
| monitor | `azmcp_monitor_healthmodels_entity_gethealth` |
1514
| communication | `azmcp_communication_sms_send`, `azmcp_communication_email_send` |
1615
| confidentialledger | `azmcp_confidentialledger_entries_append`, `azmcp_confidentialledger_entries_get` |
1716

servers/Azure.Mcp.Server/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@ Example prompts that generate Azure CLI commands:
11321132
### 📊 Azure Monitor
11331133

11341134
* "Query my Log Analytics workspace"
1135+
* "List my Azure Monitor Health Models"
1136+
* "Get details for my Azure Monitor Health Model 'my-health-model'"
11351137

11361138
### 🧭 Azure Monitor Instrumentation (under Azure Monitor)
11371139

@@ -1271,7 +1273,7 @@ The Azure MCP Server provides tools for interacting with **44+ Azure service are
12711273
- 🗃️ **Azure Managed Lustre** - High-performance Lustre filesystem operations
12721274
- 🏪 **Azure Marketplace** - Product discovery
12731275
- 🔄 **Azure Migrate** - Platform Landing Zone generation and modification guidance
1274-
- 📈 **Azure Monitor** - Logging, metrics, health monitoring, and instrumentation onboarding/migration workflow for local applications
1276+
- 📈 **Azure Monitor** - Logging, metrics, health models, health monitoring, and instrumentation onboarding/migration workflow for local applications
12751277
- ⚖️ **Azure Policy** - Policies set to enforce organizational standards
12761278
- ⚙️ **Azure Native ISV Services** - Third-party integrations
12771279
- 🛡️ **Azure Quick Review CLI** - Compliance scanning
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
changes:
2+
- section: "Features Added"
3+
description: "Replaced the broken 'monitor healthmodels entity get' command with 'monitor healthmodels list' and 'monitor healthmodels get', using the Azure Health Models 2026-05-01-preview API (Microsoft.CloudHealth) via the Azure.ResourceManager.CloudHealth SDK."

servers/Azure.Mcp.Server/docs/azmcp-commands.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,12 +3065,16 @@ azmcp monitor workspace log query --subscription <subscription> \
30653065
#### Health Models
30663066
30673067
```bash
3068-
# Get the health of an entity
3068+
# List health models in a subscription (optionally scoped to a resource group)
30693069
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
3070-
azmcp monitor healthmodels entity get --subscription <subscription> \
3071-
--resource-group <resource-group> \
3072-
--health-model <health-model-name> \
3073-
--entity <entity-id>
3070+
azmcp monitor healthmodels list --subscription <subscription> \
3071+
[--resource-group <resource-group>]
3072+
3073+
# Get (show) a single health model by name
3074+
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
3075+
azmcp monitor healthmodels get --subscription <subscription> \
3076+
--resource-group <resource-group> \
3077+
--health-model <health-model-name>
30743078
```
30753079
30763080
#### Metrics

servers/Azure.Mcp.Server/docs/e2eTestPrompts.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,9 @@ This file contains prompts used for end-to-end testing to ensure each tool is in
768768
| Tool Name | Test Prompt |
769769
|:----------|:----------|
770770
| monitor_activitylog_list | List the activity logs of the last month for <resource_name> |
771-
| monitor_healthmodels_entity_get | Show me the health status of entity <entity_id> using the health model <health_model_name> |
771+
| monitor_healthmodels_get | Show me the health model <health_model_name> in resource group <resource_group> |
772+
| monitor_healthmodels_list | List the Azure Monitor health models in my subscription |
773+
| monitor_healthmodels_list | What health models are in resource group <resource_group>? |
772774
| monitor_instrumentation_get-learning-resource | Get the onboarding learning resource at path <resource_path> |
773775
| monitor_instrumentation_get-learning-resource | Show me the content of the Azure Monitor onboarding learning resource at path <resource_path> |
774776
| monitor_instrumentation_get-learning-resource | Get the content of the Azure Monitor learning resource file at path <resource_path> |

servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@
400400
"datadog_monitoredresources_list",
401401
"monitor_workspace_list",
402402
"monitor_activitylog_list",
403-
"monitor_healthmodels_entity_get",
403+
"monitor_healthmodels_list",
404+
"monitor_healthmodels_get",
404405
"monitor_metrics_definitions",
405406
"monitor_metrics_query",
406407
"monitor_resource_log_query",

tools/Azure.Mcp.Tools.Monitor/src/Azure.Mcp.Tools.Monitor.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<PackageReference Include="Azure.Monitor.Query.Logs" />
2828
<PackageReference Include="Azure.ResourceManager" />
2929
<PackageReference Include="Azure.ResourceManager.ApplicationInsights" />
30+
<PackageReference Include="Azure.ResourceManager.CloudHealth" />
3031
<PackageReference Include="Azure.ResourceManager.OperationalInsights" />
3132
<PackageReference Include="Azure.ResourceManager.Monitor" />
3233
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />

0 commit comments

Comments
 (0)