Skip to content

Commit daa771d

Browse files
Merge pull request #312848 from hhunter-ms/hh-559950
[AMG] Add docs for AMG-MCP
2 parents 409be88 + b76af52 commit daa771d

15 files changed

Lines changed: 304 additions & 0 deletions
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
title: Configure an Azure Managed Grafana remote MCP server
3+
description: Discover MCP tools for Azure Managed Grafana. Query Application Insights, Azure Data Explorer, and more with secure authentication and easy setup.
4+
#customer intent: As a developer, I want to configure my application to interact with the AMG-MCP endpoint so that I can programmatically manage my Azure Managed Grafana instance.
5+
author: weng5e
6+
ms.author: wuweng
7+
ms.reviewer: malev
8+
ms.date: 03/09/2026
9+
ms.topic: concept-article
10+
ms.service: azure-managed-grafana
11+
---
12+
13+
# Configure an Azure Managed Grafana remote MCP server
14+
15+
Every Azure Managed Grafana instance includes a built-in Model Context Protocol (MCP) server endpoint called AMG-MCP. The AMG-MCP endpoint allows tools and applications to interact programmatically with the Grafana instance using the MCP. The AMG-MCP endpoint uses the same authentication mechanism as the Grafana instance, supporting both Entra ID and the Grafana service account token.
16+
17+
## Endpoint path
18+
19+
The AMG-MCP endpoint path format is `https://<grafana-endpoint>/api/azure-mcp`. For example, the endpoint could look like: `https://my-grafana-<guid>.<location>.grafana.azure.com/api/azure-mcp`.
20+
21+
## Available MCP tools
22+
23+
AMG-MCP provides the following tools for interacting with Azure Managed Grafana:
24+
25+
| Tool Name | Description |
26+
|-----------|-------------|
27+
| `amgmcp_insights_get_failures` | Get Failures insights. Returns failure summary data from Application Insights, such as failed requests, failed dependencies, and exceptions. |
28+
| `amgmcp_insights_get_agents` | Get GenAI agent insights. Returns GenAI agent related information from Application Insights, such as agent invocations, token usage, and latency. Queries data following 'OpenTelemetry for Generative AI' Semantic Conventions. |
29+
| `amgmcp_kusto_get_metadata` | Get the metadata for connected Azure Data Explorer (Kusto) clusters. Lists all Azure Data Explorer data sources, and for each data source, gets the clusterUrl, databases and schema. |
30+
| `amgmcp_kusto_query` | Query data in Azure Data Explorer (Kusto) cluster. |
31+
| `amgmcp_mssql_get_metadata` | Get the metadata for all connected Microsoft SQL Server data sources. Lists the databases, tables, and column schemas for each Microsoft SQL Server data source. |
32+
| `amgmcp_mssql_query` | Query data in a Microsoft SQL Server data source. |
33+
| `amgmcp_query_application_insights_trace` | Query Application Insights Trace through Grafana Azure Monitor data source. When trace data is stored in multiple Application Insights, this tool aggregates the data. |
34+
| `amgmcp_query_azure_subscriptions` | List all the Azure subscriptions that the Grafana Azure Monitor data source can access. |
35+
| `amgmcp_query_resource_graph` | Query Azure Resource Graph (ARG) through Grafana Azure Monitor data source. |
36+
| `amgmcp_query_resource_log` | Query Azure Resource Log through Grafana Azure Monitor data source. |
37+
| `amgmcp_query_resource_metric` | Query Azure Resource Metric values through Grafana Azure Monitor data source. |
38+
| `amgmcp_query_resource_metric_definition` | Query Azure Resource Metric Definitions through Grafana Azure Monitor data source. |
39+
| `amgmcp_dashboard_search` | Search for Grafana dashboards by a query string. Returns a list of matching dashboards with details like title, UID, folder, tags, and URL. |
40+
| `amgmcp_datasource_list` | List all Grafana data sources. |
41+
42+
## MCP configuration
43+
44+
To connect to the AMG-MCP endpoint, you need to configure your MCP client with the appropriate settings. AMG-MCP supports two authentication methods:
45+
46+
- [**Grafana service account token:**](#grafana-service-account-token) A token generated from your Grafana instance (format: `glsa_xxx`)
47+
- [**Entra ID token:**](#entra-id-token) An Azure AD/Entra ID token (e.g., from a managed identity or service principal)
48+
49+
### Grafana service account token
50+
51+
Use a Grafana service account token for authentication. Start by creating a token:
52+
53+
1. In the Grafana instance UI, navigate to **Administration > Service accounts**.
54+
1. [Create a new service account using the appropriate permissions.](./how-to-service-accounts.md#create-a-service-account)
55+
1. [Generate a token](./how-to-service-accounts.md#add-a-service-account-token)
56+
1. Copy the Grafana service account token (format: `glsa_xxx`) and paste into your configuration settings:
57+
58+
```json
59+
{
60+
"my-grafana-mcp-server": {
61+
"disabled": false,
62+
"timeout": 60,
63+
"type": "streamableHttp",
64+
"url": "https://my-grafana-d5ggtqegcr2safcp.wcus.grafana.azure.com/api/azure-mcp",
65+
"headers": {
66+
"Authorization": "Bearer glsa_xxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxx"
67+
}
68+
}
69+
}
70+
```
71+
72+
### Entra ID token
73+
74+
Use an Entra ID token (Azure AD token) for authentication. This approach is useful when using managed identities or service principals.
75+
76+
1. Use the Azure CLI to obtain an Entra ID token associated with the Azure Managed Grafana resource ID:
77+
78+
```bash
79+
az account get-access-token --resource ce34e7e5-485f-4d76-964f-b3d2b16d1e4f --query accessToken -o tsv
80+
```
81+
82+
1. Alternatively, use a managed identity to acquire a token programmatically with the Azure Managed Grafana audience `ce34e7e5-485f-4d76-964f-b3d2b16d1e4f`.
83+
84+
```json
85+
{
86+
"my-grafana-mcp-server": {
87+
"disabled": false,
88+
"timeout": 60,
89+
"type": "streamableHttp",
90+
"url": "https://my-grafana-d5ggtqegcr2safcp.wcus.grafana.azure.com/api/azure-mcp",
91+
"headers": {
92+
"Authorization": "Bearer <entra-id-token>"
93+
}
94+
}
95+
}
96+
```
97+
98+
## Examples
99+
100+
The following examples further demonstrate configuring AMG-MCP in your settings.
101+
102+
### Example 1: Visual Studio Code configuration
103+
104+
To configure MCP for Visual Studio Code, use configuration settings similar to the following example.
105+
106+
```json
107+
{
108+
"<your-grafana-mcp-server-name>": {
109+
"type": "http",
110+
"url": "https://<grafana-endpoint>/api/azure-mcp",
111+
"headers": {
112+
"Authorization": "Bearer <token>"
113+
}
114+
}
115+
}
116+
```
117+
118+
**Configuration parameters:**
119+
120+
| Parameter | Description |
121+
|-----------|-------------|
122+
| `type` | Transport type. Use `http` for remote MCP endpoints. |
123+
| `url` | The AMG-MCP endpoint URL: `https://<grafana-endpoint>/api/azure-mcp` |
124+
| `headers.Authorization` | Bearer token - either a Grafana service account token or an Entra ID token. |
125+
126+
### Example 2: Cline configuration
127+
128+
To configure MCP for Cline, use configuration settings similar to the following example.
129+
130+
```json
131+
{
132+
"<your-grafana-mcp-server-name>": {
133+
"disabled": false,
134+
"timeout": 60,
135+
"type": "streamableHttp",
136+
"url": "https://<grafana-endpoint>/api/azure-mcp",
137+
"headers": {
138+
"Authorization": "Bearer <token>"
139+
}
140+
}
141+
}
142+
```
143+
144+
**Configuration parameters:**
145+
146+
| Parameter | Description |
147+
|-----------|-------------|
148+
| `disabled` | Set to `false` to enable the MCP server connection. |
149+
| `timeout` | Connection timeout in seconds. |
150+
| `type` | Transport type. Use `streamableHttp` for remote MCP endpoints. |
151+
| `url` | The AMG-MCP endpoint URL: `https://<grafana-endpoint>/api/azure-mcp` |
152+
| `headers.Authorization` | Bearer token - either a Grafana service account token or an Entra ID token. |
153+
154+
155+
## Limitation
156+
157+
Currently, AMG-MCP endpoint is included with Azure Managed Grafana instances only in Azure Public Cloud, not in sovereign clouds.
158+
159+
## Troubleshooting
160+
161+
If you encounter any issues, open an issue in the [Azure Managed Grafana GitHub repo](https://aka.ms/managed-grafana/issues).
162+
163+
## Next steps
164+
165+
> [!div class="nextstepaction"]
166+
> [Configure MCP for AI Foundry agents](./how-to-configure-mcp-for-ai-foundry.md)
167+
>
168+
> [!div class="nextstepaction"]
169+
> [Enable zone redundancy](./how-to-enable-zone-redundancy.md)
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
title: Configure Azure Managed Grafana MCP for Azure AI Foundry agents
3+
description: Learn how to configure Azure Managed Grafana MCP in Azure AI Foundry so your agent can query Azure resources, metrics, and logs.
4+
author: weng5e
5+
ms.author: wuweng
6+
ms.reviewer: malev
7+
ms.date: 03/09/2026
8+
ms.topic: how-to
9+
ms.service: azure-managed-grafana
10+
#customer intent: As an AI engineer, I want to connect my Azure AI Foundry agent to the Azure Managed Grafana MCP endpoint so that the agent can query Azure resources and observability data.
11+
---
12+
13+
# Configure Azure Managed Grafana MCP for Azure AI Foundry agents
14+
15+
This article shows how to configure the Azure Managed Grafana MCP endpoint in an Azure AI Foundry agent. After configuration, your agent can use MCP tools to query Azure resources, metrics, logs, and dashboards through your Azure Managed Grafana workspace.
16+
17+
## Prerequisites
18+
19+
- An Azure subscription with permission to create and manage Azure resources.
20+
- An Azure Managed Grafana workspace. If you need one, see [Quickstart: Create an Azure Managed Grafana workspace](./quickstart-managed-grafana-portal.md).
21+
- An Azure AI Foundry project where you can create an agent.
22+
- Permission to assign Azure role-based access control (RBAC) roles on the Azure Managed Grafana resource.
23+
- A configured Grafana data source for the workloads you want the agent to query (for example, Azure Monitor for Resource Graph, metrics, and logs). For setup guidance, see [Configure data sources](./how-to-data-source-plugins-managed-identity.md).
24+
25+
## Get your Azure Managed Grafana endpoint
26+
27+
You use the endpoint hostname when you configure the tool in Foundry.
28+
29+
1. In the [Azure portal](https://portal.azure.com), open your Azure Managed Grafana resource.
30+
1. On the **Overview** page, copy the **Endpoint** value. For example: `my-grafana-<id>.<region>.grafana.azure.com`.
31+
32+
:::image type="content" source="media/how-to-configure-mcp-for-ai-foundry/1-find-grafana-endpoint.png" alt-text="Screenshot of Azure portal showing the Azure Managed Grafana endpoint on the Overview page." lightbox="media/how-to-configure-mcp-for-ai-foundry/1-find-grafana-endpoint-expanded.png":::
33+
34+
## Grant your Foundry project identity access to Azure Managed Grafana
35+
36+
Your Azure AI Foundry project uses a managed identity to access tools and data sources.
37+
38+
1. In the Azure portal, open your Azure Managed Grafana resource.
39+
1. Select **Access control (IAM)** > **Add** > **Add role assignment**.
40+
1. Assign one of these roles to the Foundry project managed identity:
41+
42+
- **Grafana Admin**
43+
- **Grafana Editor**
44+
- **Grafana Viewer**
45+
46+
Choose the least privileged role that satisfies your scenario.
47+
48+
To find the correct principal:
49+
50+
1. Open your Foundry project in Azure portal.
51+
1. Use the managed identity shown under **Identity**.
52+
53+
> [!NOTE]
54+
> Role assignments can take a few minutes to propagate. If the first validation attempt fails with authorization errors, wait and try again.
55+
56+
:::image type="content" source="media/how-to-configure-mcp-for-ai-foundry/2-add-role-based-access-control.png" alt-text="Screenshot of Azure portal showing a role assignment being added to Azure Managed Grafana." lightbox="media/how-to-configure-mcp-for-ai-foundry/2-add-role-based-access-control-expanded.png":::
57+
58+
## Create an agent in Azure AI Foundry
59+
60+
1. Open [Azure AI Foundry](https://ai.azure.com) and go to your project.
61+
1. Select **Agents** > **+ New agent**.
62+
1. Select a model that supports tool calling. In this example, we use `gpt-5.1`.
63+
1. Enter a name and description for the agent.
64+
65+
:::image type="content" source="media/how-to-configure-mcp-for-ai-foundry/3-create-new-agent.png" alt-text="Screenshot of Azure AI Foundry showing the New agent creation flow." lightbox="media/how-to-configure-mcp-for-ai-foundry/3-create-new-agent-expanded.png":::
66+
67+
## Add the Azure Managed Grafana MCP tool
68+
69+
1. In the agent configuration, go to **Tools**.
70+
1. Select **+ Add tool**.
71+
1. Select **Catalog**, then select **Azure Managed Grafana**.
72+
73+
:::image type="content" source="media/how-to-configure-mcp-for-ai-foundry/4-agent-add-mcp.png" alt-text="Screenshot of Azure AI Foundry agent tool catalog with Azure Managed Grafana selected." lightbox="media/how-to-configure-mcp-for-ai-foundry/4-agent-add-mcp-expanded.png":::
74+
75+
1. Configure the tool settings:
76+
77+
| Setting | Value |
78+
| --- | --- |
79+
| **workspace-hostname** | Your Azure Managed Grafana endpoint hostname. Enter only the hostname. Don't include `https://` or `/api/azure-mcp`. |
80+
| **Authentication** | **Microsoft Entra** |
81+
| **Type** | **Project Managed Identity** |
82+
| **Audience** | The application ID for Azure Managed Grafana: `ce34e7e5-485f-4d76-964f-b3d2b16d1e4f` |
83+
84+
85+
:::image type="content" source="media/how-to-configure-mcp-for-ai-foundry/5-mcp-config.png" alt-text="Screenshot of Azure AI Foundry showing Azure Managed Grafana MCP tool configuration values." lightbox="media/how-to-configure-mcp-for-ai-foundry/5-mcp-config-expanded.png":::
86+
87+
## Validate the sample
88+
89+
After you save the tool configuration, validate the setup from the agent chat.
90+
91+
1. Open the chat panel for your agent.
92+
1. Submit a connectivity prompt, like *List all Azure subscriptions available through Azure Managed Grafana MCP*.
93+
1. Confirm that the response includes grounded tool output rather than a generic model-only answer.
94+
95+
:::image type="content" source="media/how-to-configure-mcp-for-ai-foundry/6-agent-trigger-resource-graph.png" alt-text="Screenshot of Azure AI Foundry chat where the agent invokes Azure Managed Grafana MCP tools." lightbox="media/how-to-configure-mcp-for-ai-foundry/6-agent-trigger-resource-graph-expanded.png":::
96+
97+
### Sample prompts
98+
99+
You can use any of the following sample prompts:
100+
101+
- `List all Azure Managed Grafana instances in my subscriptions.`
102+
- `Show me all virtual machines in resource group <resource-group-name>.`
103+
- `Find all storage accounts with public access enabled.`
104+
105+
### Troubleshoot validation
106+
107+
If validation fails:
108+
109+
- Verify the managed identity has a Grafana role on the Azure Managed Grafana resource.
110+
- Verify the **workspace-hostname** value is the Grafana hostname only.
111+
- Verify the audience is `ce34e7e5-485f-4d76-964f-b3d2b16d1e4f`.
112+
- Verify the Grafana data source required by the prompt exists and can access the target Azure scope.
113+
- Check for RBAC propagation delay and retry after a few minutes.
114+
115+
## Clean up resources
116+
117+
If you created resources only for this test, remove access and resources to avoid ongoing charges.
118+
119+
1. Remove the test role assignment from your Azure Managed Grafana resource:
120+
121+
1. Open **Access control (IAM)** on the Azure Managed Grafana resource.
122+
1. Select **Role assignments**.
123+
1. Find the Foundry project managed identity assignment and remove it.
124+
125+
1. In Azure AI Foundry, remove the Azure Managed Grafana tool from the agent, or delete the test agent.
126+
1. Optionally delete test resources such as the Foundry project and Azure Managed Grafana workspace if they were created only for this walkthrough.
127+
128+
## Next steps
129+
130+
- Learn more about the remote MCP endpoint in [Configure an Azure Managed Grafana remote MCP server](./grafana-mcp-server.md).
131+
- Explore dashboard examples in [Create dashboards for GenAI applications](./azure-ai-foundry-dashboard.md).
350 KB
Loading
128 KB
Loading
177 KB
Loading
54.3 KB
Loading
198 KB
Loading
79.8 KB
Loading
466 KB
Loading
121 KB
Loading

0 commit comments

Comments
 (0)