---
title: "Azure Monitor data source | Grafana documentation"
description: "Guide for using Azure Monitor in Grafana"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Azure Monitor data source

The Azure Monitor data source plugin allows you to query and visualize data from Azure Monitor, the Azure service to maximize the availability and performance of applications and services in the Azure Cloud.

## Supported features

Expand table

| Feature     | Supported |
|-------------|-----------|
| Metrics     | Yes       |
| Logs        | Yes       |
| Traces      | Yes       |
| Alerting    | Yes       |
| Annotations | Yes       |

> Note
> 
> The Azure Monitor data source requires Grafana 12.3 or later.

## Supported Azure clouds

The Azure Monitor data source supports the following Azure cloud environments:

- **Azure** - Azure public cloud (default)
- **Azure US Government** - Azure Government cloud
- **Azure China** - Azure China cloud operated by 21Vianet

## Supported Azure services

The Azure Monitor data source supports the following Azure services:

Expand table

| Service                         | Description                                                                                                                 |
|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| **Azure Monitor Metrics**       | Collect numeric data from resources in your Azure account. Supports dimensions, aggregations, and time grain configuration. |
| **Azure Monitor Logs**          | Collect log and performance data from your Azure account using the Kusto Query Language (KQL).                              |
| **Azure Resource Graph**        | Query your Azure resources across subscriptions using KQL. Useful for inventory, compliance, and resource management.       |
| **Application Insights Traces** | Collect distributed trace data and correlate requests across your application components.                                   |

## Get started

The following documents help you get started with the Azure Monitor data source:

- [Configure the Azure Monitor data source](/docs/grafana/latest/datasources/azure-monitor/configure/) - Set up authentication and connect to Azure
- [Azure Monitor query editor](/docs/grafana/latest/datasources/azure-monitor/query-editor/) - Create and edit queries for Metrics, Logs, Traces, and Resource Graph
- [Template variables](/docs/grafana/latest/datasources/azure-monitor/template-variables/) - Create dynamic dashboards with Azure Monitor variables
- [Alerting](/docs/grafana/latest/datasources/azure-monitor/alerting/) - Create alert rules using Azure Monitor data
- [Troubleshooting](/docs/grafana/latest/datasources/azure-monitor/troubleshooting/) - Solve common configuration and query errors

## Additional features

After you have configured the Azure Monitor data source, you can:

- Add [Annotations](/docs/grafana/latest/datasources/azure-monitor/annotations/) to overlay Azure log events on your graphs.
- Configure and use [Template variables](/docs/grafana/latest/datasources/azure-monitor/template-variables/) for dynamic dashboards.
- Add [Transformations](/docs/grafana/latest/panels-visualizations/query-transform-data/transform-data/) to manipulate query results.
- Set up [Alerting](/docs/grafana/latest/datasources/azure-monitor/alerting/) and recording rules using Metrics, Logs, Traces, and Resource Graph queries.
- Use [Explore](/docs/grafana/latest/explore/) to investigate your Azure data without building a dashboard.

## Pre-built dashboards

The Azure Monitor plugin includes pre-built dashboards organized by category:

**Infrastructure monitoring:**

- Azure / Infrastructure / Apps Monitoring
- Azure / Infrastructure / Compute Monitoring
- Azure / Infrastructure / Data Monitoring
- Azure / Infrastructure / Network Monitoring
- Azure / Infrastructure / Storage and Key Vaults Monitoring

**Azure Insights:**

- Azure / Insights / Applications
- Azure / Insights / Applications / Performance / Operations
- Azure / Insights / Applications / Performance / Dependencies
- Azure / Insights / Applications / Failures / Operations
- Azure / Insights / Applications / Failures / Dependencies
- Azure / Insights / Applications / Failures / Exceptions
- Azure / Insights / Applications Test Availability Geo Map
- Azure / Insights / CosmosDB
- Azure / Insights / Data Explorer Clusters
- Azure / Insights / Key Vaults
- Azure / Insights / Networks
- Azure / Insights / SQL Database
- Azure / Insights / Storage Accounts
- Azure / Insights / Virtual Machines by Resource Group
- Azure / Insights / Virtual Machines by Workspace

**Other:**

- Azure / Alert Consumption
- Azure / Azure PostgreSQL / Flexible Server Monitoring
- Azure Monitor / Container Insights / Syslog
- Azure / Resources Overview

To import a pre-built dashboard:

1. Go to **Connections** &gt; **Data sources**.
2. Select your Azure Monitor data source.
3. Click the **Dashboards** tab.
4. Click **Import** next to the dashboard you want to use.

## Plugin updates

Always ensure that your plugin version is up-to-date so you have access to all current features and improvements. Navigate to **Plugins and data** &gt; **Plugins** to check for updates. Grafana recommends upgrading to the latest Grafana version, and this applies to plugins as well.

> Note
> 
> Plugins are automatically updated in Grafana Cloud.

## Query with the Grafana CLI

You can query this data source from the command line and from AI coding agents using the Grafana CLI, `gcx`. `gcx` gives you and your agent structured, terminal-based access to your Grafana data sources, which is useful for automation and agent-driven investigations.

`gcx` supports Grafana Cloud and Grafana OSS or Enterprise v12 and later. Before you query, install and authenticate `gcx`. Refer to the [`gcx` CLI documentation](/docs/grafana/latest/as-code/observability-as-code/grafana-cli/gcx/) for installation, configuration, and the full command reference.

For example, to explore and query your Azure Monitor data source, use the `gcx datasources azuremonitor` commands:

sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```sh
# Discover subscriptions, resource groups, and resources
gcx datasources azuremonitor list-subscriptions -d <DATASOURCE_UID>
gcx datasources azuremonitor list-resource-groups -d <DATASOURCE_UID> --subscription <SUBSCRIPTION_ID>
gcx datasources azuremonitor list-resources -d <DATASOURCE_UID> --subscription <SUBSCRIPTION_ID> --resource-group my-rg

# List the metrics available for a resource
gcx datasources azuremonitor list-metrics -d <DATASOURCE_UID> --subscription <SUBSCRIPTION_ID> \
  --resource-group my-rg --namespace Microsoft.Compute/virtualMachines --resource my-vm

# Run a structured metrics query
gcx datasources azuremonitor query -d <DATASOURCE_UID> --subscription <SUBSCRIPTION_ID> \
  --resource-group my-rg --namespace Microsoft.Compute/virtualMachines --resource my-vm \
  --metric 'Percentage CPU' --aggregation Average --since 1h

# Query a Log Analytics workspace with KQL
gcx datasources azuremonitor logs query 'AppRequests | take 10' -d <DATASOURCE_UID> \
  --subscription <SUBSCRIPTION_ID> --resource-group my-rg --workspace my-workspace

# Query Azure Resource Graph with KQL
gcx datasources azuremonitor resource-graph query 'Resources | project name, type | limit 10' \
  -d <DATASOURCE_UID> --subscription <SUBSCRIPTION_ID>
```

Replace *`<DATASOURCE_UID>`* with the UID of your Azure Monitor data source and *`<SUBSCRIPTION_ID>`* with an Azure subscription ID. You can omit the `-d` flag when `datasources.azuremonitor` is configured in your `gcx` context. Metrics queries are structured rather than expression-based, so `--subscription`, `--resource-group`, `--namespace`, `--resource`, and `--metric` are required, while `logs query` and `resource-graph query` take KQL. Data sources configured with **Current User** authentication can’t be queried with API tokens or service accounts.

## Related resources

- [Azure Monitor documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/)
- [Kusto Query Language (KQL) reference](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/)
- [Grafana community forum](https://community.grafana.com/)
