Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"chilecentral",
"cicd",
"cloudarchitect",
"cloudhealth",
"codegen",
"codeium",
"codeowners",
Expand Down
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageVersion Include="Azure.AI.Agents.Persistent" Version="1.2.0-beta.4" />
<PackageVersion Include="Azure.AI.OpenAI" Version="2.8.0-beta.1" />
<PackageVersion Include="Azure.Bicep.Types" Version="0.6.50" />
<PackageVersion Include="Azure.Core" Version="1.55.0" />
<PackageVersion Include="Azure.Core" Version="1.58.0" />
<PackageVersion Include="Azure.Data.AppConfiguration" Version="1.6.1" />
<PackageVersion Include="Azure.Data.Tables" Version="12.11.0" />
<PackageVersion Include="Azure.Identity" Version="1.21.0" />
Expand All @@ -25,6 +25,7 @@
<PackageVersion Include="Azure.ResourceManager.ApplicationInsights" Version="1.1.0-beta.1" />
<PackageVersion Include="Azure.ResourceManager.AppContainers" Version="1.4.1" />
<PackageVersion Include="Azure.ResourceManager.AppService" Version="1.4.1" />
<PackageVersion Include="Azure.ResourceManager.CloudHealth" Version="1.0.0-beta.3" />
<PackageVersion Include="Azure.ResourceManager.ContainerInstance" Version="1.3.0-beta.3" />
<PackageVersion Include="Azure.ResourceManager.Compute" Version="1.11.0" />
<PackageVersion Include="Azure.ResourceManager.HDInsight" Version="1.2.0-beta.5" />
Expand Down Expand Up @@ -94,7 +95,7 @@
<PackageVersion Include="Npgsql" Version="10.0.1" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="Yarp.ReverseProxy" Version="2.3.0" />
<PackageVersion Include="System.ClientModel" Version="1.11.0" />
<PackageVersion Include="System.ClientModel" Version="1.14.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.6" />
<PackageVersion Include="System.Formats.Asn1" Version="10.0.6" />
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.17.0" />
Expand Down
9 changes: 7 additions & 2 deletions eng/tools/ToolDescriptionEvaluator/prompts/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,13 @@
"monitor_activitylog_list": [
"List the activity logs of the last month for <resource_name>"
],
"monitor_healthmodels_entity_get": [
"Show me the health status of entity <entity_id> using the health model <health_model_name>"
"monitor_healthmodels_get": [
"Show me the health model <health_model_name> in resource group <resource_group>",
"Get the Azure Monitor health model named <health_model_name>"
],
"monitor_healthmodels_list": [
"List the Azure Monitor health models in my subscription",
"What health models are in resource group <resource_group>?"
],
"monitor_metrics_definitions": [
"Get metric definitions for <resource_type> <resource_name> from the namespace",
Expand Down
1 change: 0 additions & 1 deletion servers/Azure.Mcp.Server/KNOWN-ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The following tools are not supported when the Azure MCP Server is running in HT

| Namespace | Impacted Tools |
|-----------|----------------|
| monitor | `azmcp_monitor_healthmodels_entity_gethealth` |
| communication | `azmcp_communication_sms_send`, `azmcp_communication_email_send` |
| confidentialledger | `azmcp_confidentialledger_entries_append`, `azmcp_confidentialledger_entries_get` |

Expand Down
4 changes: 3 additions & 1 deletion servers/Azure.Mcp.Server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,8 @@ Example prompts that generate Azure CLI commands:
### 📊 Azure Monitor

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

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

Expand Down Expand Up @@ -1255,7 +1257,7 @@ The Azure MCP Server provides tools for interacting with **44+ Azure service are
- 🗃️ **Azure Managed Lustre** - High-performance Lustre filesystem operations
- 🏪 **Azure Marketplace** - Product discovery
- 🔄 **Azure Migrate** - Platform Landing Zone generation and modification guidance
- 📈 **Azure Monitor** - Logging, metrics, health monitoring, and instrumentation onboarding/migration workflow for local applications
- 📈 **Azure Monitor** - Logging, metrics, health models, health monitoring, and instrumentation onboarding/migration workflow for local applications
- ⚖️ **Azure Policy** - Policies set to enforce organizational standards
- ⚙️ **Azure Native ISV Services** - Third-party integrations
- 🛡️ **Azure Quick Review CLI** - Compliance scanning
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
changes:
- section: "Features Added"
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."
14 changes: 9 additions & 5 deletions servers/Azure.Mcp.Server/docs/azmcp-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -3065,12 +3065,16 @@ azmcp monitor workspace log query --subscription <subscription> \
#### Health Models

```bash
# Get the health of an entity
# List health models in a subscription (optionally scoped to a resource group)
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
azmcp monitor healthmodels entity get --subscription <subscription> \
--resource-group <resource-group> \
--health-model <health-model-name> \
--entity <entity-id>
azmcp monitor healthmodels list --subscription <subscription> \
[--resource-group <resource-group>]

# Get (show) a single health model by name
# ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired
azmcp monitor healthmodels get --subscription <subscription> \
--resource-group <resource-group> \
--health-model <health-model-name>
```

#### Metrics
Expand Down
4 changes: 3 additions & 1 deletion servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,9 @@ This file contains prompts used for end-to-end testing to ensure each tool is in
| Tool Name | Test Prompt |
|:----------|:----------|
| monitor_activitylog_list | List the activity logs of the last month for <resource_name> |
| monitor_healthmodels_entity_get | Show me the health status of entity <entity_id> using the health model <health_model_name> |
| monitor_healthmodels_get | Show me the health model <health_model_name> in resource group <resource_group> |
| monitor_healthmodels_list | List the Azure Monitor health models in my subscription |
| monitor_healthmodels_list | What health models are in resource group <resource_group>? |
| monitor_instrumentation_get-learning-resource | Get the onboarding learning resource at path <resource_path> |
| monitor_instrumentation_get-learning-resource | Show me the content of the Azure Monitor onboarding learning resource at path <resource_path> |
| monitor_instrumentation_get-learning-resource | Get the content of the Azure Monitor learning resource file at path <resource_path> |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@
"datadog_monitoredresources_list",
"monitor_workspace_list",
"monitor_activitylog_list",
"monitor_healthmodels_entity_get",
"monitor_healthmodels_list",
"monitor_healthmodels_get",
"monitor_metrics_definitions",
"monitor_metrics_query",
"monitor_resource_log_query",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<PackageReference Include="Azure.Monitor.Query.Logs" />
<PackageReference Include="Azure.ResourceManager" />
<PackageReference Include="Azure.ResourceManager.ApplicationInsights" />
<PackageReference Include="Azure.ResourceManager.CloudHealth" />
<PackageReference Include="Azure.ResourceManager.OperationalInsights" />
<PackageReference Include="Azure.ResourceManager.Monitor" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Azure.Mcp.Core.Commands.Subscription;
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Tools.Monitor.Models.HealthModels;
using Azure.Mcp.Tools.Monitor.Options.HealthModels;
using Azure.Mcp.Tools.Monitor.Services;
using Microsoft.Mcp.Core.Commands;
using Microsoft.Mcp.Core.Models.Command;

namespace Azure.Mcp.Tools.Monitor.Commands.HealthModels;

[CommandMetadata(
Id = "1e5a6b2c-0d4e-4f8a-9b3c-7a2d8e1f6b0d",
Name = "get",
Title = "Get an Azure Monitor Health Model",
Description = """
Get (show/view) a single, specific Azure Monitor Health Model by name, within a resource group and subscription.
Returns the model's metadata and if available, the health state (e.g. Healthy, Degraded, Unhealthy, Unknown) or null if it cannot be provided.
""",
Destructive = false,
Idempotent = true,
OpenWorld = false,
ReadOnly = true,
Secret = false,
LocalRequired = false)]
public sealed class HealthModelGetCommand(IMonitorHealthModelService healthModelService, ISubscriptionResolver subscriptionResolver)
: SubscriptionCommand<HealthModelGetOptions, HealthModelGetCommand.HealthModelGetCommandResult>(subscriptionResolver)
{
private readonly IMonitorHealthModelService _healthModelService = healthModelService;

public override async Task<CommandResponse> ExecuteAsync(CommandContext context, HealthModelGetOptions options, CancellationToken cancellationToken)
{
try
{
var model = await _healthModelService.GetHealthModel(
options.Subscription!,
options.ResourceGroup,
options.HealthModel,
options.Tenant,
options.RetryPolicy,
cancellationToken);

context.Response.Results = ResponseResult.Create(new(model), MonitorJsonContext.Default.HealthModelGetCommandResult);
}
catch (Exception ex)
{
HandleException(context, ex);
}

return context.Response;
}

public sealed record HealthModelGetCommandResult(HealthModelDetail HealthModel);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Azure.Mcp.Core.Commands.Subscription;
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Tools.Monitor.Models.HealthModels;
using Azure.Mcp.Tools.Monitor.Options.HealthModels;
using Azure.Mcp.Tools.Monitor.Services;
using Microsoft.Mcp.Core.Commands;
using Microsoft.Mcp.Core.Models.Command;

namespace Azure.Mcp.Tools.Monitor.Commands.HealthModels;

[CommandMetadata(
Id = "9d9d2f3a-6f9d-4a3a-8d7f-2c0b6a1f5e4c",
Name = "list",
Title = "List Azure Monitor Health Models",
Description = """
List (find/show/enumerate) Azure Monitor Health Models (Microsoft.CloudHealth/healthmodels) in a subscription, or scoped to a specific resource group.
Returns a summary of each health model, including its name, resource group, and location.
""",
Destructive = false,
Idempotent = true,
OpenWorld = false,
ReadOnly = true,
Secret = false,
LocalRequired = false)]
public sealed class HealthModelListCommand(IMonitorHealthModelService healthModelService, ISubscriptionResolver subscriptionResolver)
: SubscriptionCommand<HealthModelListOptions, List<HealthModelSummary>>(subscriptionResolver)
{
private readonly IMonitorHealthModelService _healthModelService = healthModelService;

public override async Task<CommandResponse> ExecuteAsync(CommandContext context, HealthModelListOptions options, CancellationToken cancellationToken)
{
try
{
var models = await _healthModelService.ListHealthModels(
options.Subscription!,
options.ResourceGroup,
options.Tenant,
options.RetryPolicy,
cancellationToken);

context.Response.Results = ResponseResult.Create(models, MonitorJsonContext.Default.ListHealthModelSummary);
}
catch (Exception ex)
{
HandleException(context, ex);
}

return context.Response;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using Azure.Mcp.Tools.Monitor.Commands.ActivityLog;
using Azure.Mcp.Tools.Monitor.Commands.HealthModels;
using Azure.Mcp.Tools.Monitor.Commands.Instrumentation;
using Azure.Mcp.Tools.Monitor.Commands.Metrics;
using Azure.Mcp.Tools.Monitor.Commands.Table;
using Azure.Mcp.Tools.Monitor.Commands.TableType;
using Azure.Mcp.Tools.Monitor.Commands.WebTests;
using Azure.Mcp.Tools.Monitor.Commands.Workspace;
using Azure.Mcp.Tools.Monitor.Models.ActivityLog;
using Azure.Mcp.Tools.Monitor.Models.HealthModels;

namespace Azure.Mcp.Tools.Monitor.Commands;

Expand All @@ -21,6 +23,11 @@ namespace Azure.Mcp.Tools.Monitor.Commands;
[JsonSerializable(typeof(ActivityLogListResponse))]
[JsonSerializable(typeof(ActivityLogLocalizableString))]
[JsonSerializable(typeof(GetLearningResourceCommand.GetLearningResourceCommandResult))]
[JsonSerializable(typeof(HealthModelDetail))]
[JsonSerializable(typeof(HealthModelGetCommand.HealthModelGetCommandResult))]
[JsonSerializable(typeof(HealthModelIdentity))]
[JsonSerializable(typeof(HealthModelSummary))]
[JsonSerializable(typeof(List<HealthModelSummary>))]
[JsonSerializable(typeof(List<JsonNode>))]
[JsonSerializable(typeof(MetricsDefinitionsCommand.MetricsDefinitionsCommandResult))]
[JsonSerializable(typeof(MetricsDefinitionsCommand.MetricsDefinitionsCommandResult))]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Text.Json.Serialization;

namespace Azure.Mcp.Tools.Monitor.Models.HealthModels;

/// <summary>
/// Azure Monitor Health Model with its identity and tags and a health state.
/// <see cref="HealthState"/> is null when the root entity's health cannot be retrieved.
/// </summary>
public sealed class HealthModelDetail : HealthModelSummary
{
[JsonPropertyName("healthState")]
public string? HealthState { get; set; }

[JsonPropertyName("identity")]
public HealthModelIdentity? Identity { get; set; }

[JsonPropertyName("tags")]
public IDictionary<string, string>? Tags { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Text.Json.Serialization;

namespace Azure.Mcp.Tools.Monitor.Models.HealthModels;

/// <summary>
/// Managed identity configuration of an Azure Monitor Health Model.
/// </summary>
public sealed class HealthModelIdentity
{
[JsonPropertyName("type")]
public string? Type { get; set; }

[JsonPropertyName("principalId")]
public string? PrincipalId { get; set; }

[JsonPropertyName("tenantId")]
public string? TenantId { get; set; }

[JsonPropertyName("userAssignedIdentities")]
public IReadOnlyList<string>? UserAssignedIdentities { get; set; }
}
Loading