Edit

Connect Grafana to Azure Monitor managed service for Prometheus

The most common way to analyze and present Prometheus data is with a Grafana dashboard. This article explains how to configure Azure Monitor managed service for Prometheus as a data source for different versions of Grafana including Azure Managed Grafana, self-hosted Grafana running on an Azure VM, and a Grafana instance running outside Azure.

Important

Azure Monitor dashboards with Grafana is now in public preview. This version of Grafana is hosted in Azure and requires no configuration to connect to Azure Monitor managed service for Prometheus. This article describes how to connect to an Azure Monitor workspace to include Prometheus metrics in other versions of Grafana that do require configuration.

Azure Monitor workspace query endpoint

Azure Monitor managed service for Prometheus stores data in an Azure Monitor workspace. Each version of Grafana uses the query endpoint for this workspace to access it. To find the query endpoint, open the Overview page for your Azure Monitor workspace in the Azure portal.

Screenshot that shows the query endpoint URL for an Azure Monitor workspace.

Configure Grafana

Starting with Grafana 13, Azure authentication for Prometheus is available only through the Azure Monitor Managed Service for Prometheus data source plugin, not the core (open-source) Prometheus data source. In Grafana 11 and 12, the core Prometheus data source also supports Azure authentication. On Grafana 13 and later, use the Azure Monitor Managed Service for Prometheus plugin to connect to an Azure Monitor workspace. For background, see Prometheus data source update: Redefining our big tent philosophy. For migration details, see Azure authentication for the Prometheus data source.

Note

Existing Azure-authenticated Prometheus data sources migrate to the plugin automatically, so your dashboards, alerts, and queries keep working. Data sources that use non-Azure authentication are unaffected.

An Azure Managed Grafana instance is automatically configured with a managed identity with the Monitoring Data Reader role required to allow the identity to read any monitoring data for the subscription. The identity is used to authenticate Grafana to Azure Monitor.

For more information about the data source plugins that Azure Managed Grafana supports, see Manage data source plugins for Azure Managed Grafana.

Create the Prometheus data source in Grafana

Use the following steps to configure Prometheus as a data source:

  1. Open your Azure Managed Grafana workspace in the Azure portal and select the endpoint to view the Grafana workspace.

  2. Select Connections > Data sources and then Add data source.

  3. Search for and select the Prometheus data source. On Grafana 13 and later, select Azure Monitor Managed Service for Prometheus. On Grafana 11 and 12, select Prometheus.

  4. Paste the query endpoint from your Azure Monitor workspace into the Prometheus server URL field.

  5. Under Authentication, select Azure Auth.

  6. Under Azure Authentication, select Managed Identity from the Authentication dropdown list.

  7. Scroll to the bottom of the page and select Save & test.

    Screenshot that shows configuration for Prometheus data source.