<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Azure Monitor data source on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/</link><description>Recent content in Azure Monitor data source on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/datasources/azure-monitor/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure the Azure Monitor data source</title><link>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/configure/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/configure/</guid><content><![CDATA[&lt;h1 id=&#34;configure-the-azure-monitor-data-source&#34;&gt;Configure the Azure Monitor data source&lt;/h1&gt;
&lt;p&gt;This document explains how to configure the Azure Monitor data source and the available configuration options.
For general information about data sources, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/&#34;&gt;Grafana data sources&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/data-source-management/&#34;&gt;Data source management&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;Before configuring the Azure Monitor data source, ensure you have the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Grafana permissions:&lt;/strong&gt; You must have the &lt;code&gt;Organization administrator&lt;/code&gt; role to configure data sources.
Organization administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with the Grafana provisioning system or &lt;a href=&#34;#configure-with-terraform&#34;&gt;using Terraform&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Azure prerequisites:&lt;/strong&gt; Depending on your chosen authentication method, you may need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Microsoft Entra ID (formerly Azure AD) app registration with a service principal (for App Registration authentication)&lt;/li&gt;
&lt;li&gt;A Managed Identity enabled on your Azure VM or App Service (for Managed Identity authentication)&lt;/li&gt;
&lt;li&gt;Workload identity configured in your Kubernetes cluster (for Workload Identity authentication)&lt;/li&gt;
&lt;li&gt;Microsoft Entra ID authentication configured for Grafana login (for Current User authentication)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Grafana Cloud users:&lt;/strong&gt; Managed Identity and Workload Identity authentication methods are not available in Grafana Cloud because they require Grafana to run on your Azure infrastructure. Use &lt;strong&gt;App Registration&lt;/strong&gt; authentication instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Azure RBAC permissions:&lt;/strong&gt; The identity used to authenticate must have the &lt;code&gt;Reader&lt;/code&gt; role on the Azure subscription containing the resources you want to monitor.
For Log Analytics queries, the identity also needs appropriate permissions on the Log Analytics workspaces to be queried.
Refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal?tabs=current&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation for role assignments&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The Azure Monitor data source plugin is built into Grafana. No additional installation is required.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;add-the-data-source&#34;&gt;Add the data source&lt;/h2&gt;
&lt;p&gt;To add the Azure Monitor data source:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Connections&lt;/strong&gt; in the left-side menu.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add new connection&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;Azure Monitor&lt;/code&gt; in the search bar.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Azure Monitor&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add new data source&lt;/strong&gt; in the upper right.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You&amp;rsquo;re taken to the &lt;strong&gt;Settings&lt;/strong&gt; tab where you can configure the data source.&lt;/p&gt;
&lt;h2 id=&#34;choose-an-authentication-method&#34;&gt;Choose an authentication method&lt;/h2&gt;
&lt;p&gt;The Azure Monitor data source supports four authentication methods. Choose based on where Grafana is hosted and your security requirements:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Authentication method&lt;/th&gt;
              &lt;th&gt;Best for&lt;/th&gt;
              &lt;th&gt;Requirements&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;App Registration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Any Grafana deployment&lt;/td&gt;
              &lt;td&gt;Microsoft Entra ID app registration with client secret&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Managed Identity&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Grafana hosted in Azure (VMs, App Service)&lt;/td&gt;
              &lt;td&gt;Managed identity enabled on the Azure resource&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Workload Identity&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Grafana in Kubernetes (AKS)&lt;/td&gt;
              &lt;td&gt;Workload identity federation configured&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Current User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;User-level access control&lt;/td&gt;
              &lt;td&gt;Microsoft Entra ID authentication configured for Grafana login&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;configure-authentication&#34;&gt;Configure authentication&lt;/h2&gt;
&lt;p&gt;Select one of the following authentication methods and complete the configuration.&lt;/p&gt;
&lt;h3 id=&#34;app-registration&#34;&gt;App Registration&lt;/h3&gt;
&lt;p&gt;Use a Microsoft Entra ID app registration (service principal) to authenticate. This method works with any Grafana deployment.&lt;/p&gt;
&lt;h4 id=&#34;app-registration-prerequisites&#34;&gt;App Registration prerequisites&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create an app registration in Microsoft Entra ID.
Refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#get-tenant-and-app-id-values-for-signing-in&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation for creating a service principal&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a client secret for the app registration.
Refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation for creating a client secret&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Assign the &lt;code&gt;Reader&lt;/code&gt; role to the app registration on the subscription or resources you want to monitor.
Refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal?tabs=current&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation for role assignments&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;app-registration-ui-configuration&#34;&gt;App Registration UI configuration&lt;/h4&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Authentication&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Select &lt;strong&gt;App Registration&lt;/strong&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Azure Cloud&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The Azure environment to connect to. Select &lt;strong&gt;Azure&lt;/strong&gt; for the public cloud, or choose Azure Government or Azure China for national clouds.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Directory (tenant) ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The GUID that identifies your Microsoft Entra ID tenant.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Application (client) ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The GUID for the app registration you created.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Client secret&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The secret key for the app registration. Keep this secure and rotate periodically.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default Subscription&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Click &lt;strong&gt;Load Subscriptions&lt;/strong&gt; to populate available subscriptions, then select your default.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h4 id=&#34;provision-app-registration-with-yaml&#34;&gt;Provision App Registration with YAML&lt;/h4&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: 1

datasources:
  - name: Azure Monitor
    type: grafana-azure-monitor-datasource
    access: proxy
    jsonData:
      azureAuthType: clientsecret
      cloudName: azuremonitor # See supported cloud names below
      tenantId: &amp;lt;tenant-id&amp;gt;
      clientId: &amp;lt;client-id&amp;gt;
      subscriptionId: &amp;lt;subscription-id&amp;gt; # Optional, default subscription
    secureJsonData:
      clientSecret: &amp;lt;client-secret&amp;gt;
    version: 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;managed-identity&#34;&gt;Managed Identity&lt;/h3&gt;
&lt;p&gt;Use Azure Managed Identity for secure, credential-free authentication when Grafana is hosted in Azure.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Managed Identity is available in &lt;a href=&#34;https://azure.microsoft.com/en-us/products/managed-grafana&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure Managed Grafana&lt;/a&gt; or self-hosted Grafana deployed in Azure. It is not available in Grafana Cloud.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;managed-identity-prerequisites&#34;&gt;Managed Identity prerequisites&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Grafana must be hosted in Azure (App Service, Azure VMs, or Azure Managed Grafana).&lt;/li&gt;
&lt;li&gt;Managed identity must be enabled on the Azure resource hosting Grafana.&lt;/li&gt;
&lt;li&gt;The managed identity must have the &lt;code&gt;Reader&lt;/code&gt; role on the subscription or resources you want to monitor.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For details on Azure managed identities, refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;managed-identity-grafana-server-configuration&#34;&gt;Managed Identity Grafana server configuration&lt;/h4&gt;
&lt;p&gt;Enable managed identity in the Grafana server configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[azure]
managed_identity_enabled = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To use a user-assigned managed identity instead of the system-assigned identity, also set:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[azure]
managed_identity_enabled = true
managed_identity_client_id = &amp;lt;USER_ASSIGNED_IDENTITY_CLIENT_ID&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#azure&#34;&gt;Grafana Azure configuration&lt;/a&gt; for more details.&lt;/p&gt;
&lt;h4 id=&#34;managed-identity-ui-configuration&#34;&gt;Managed Identity UI configuration&lt;/h4&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Authentication&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Select &lt;strong&gt;Managed Identity&lt;/strong&gt;. The directory ID, application ID, and client secret fields are hidden.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default Subscription&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Click &lt;strong&gt;Load Subscriptions&lt;/strong&gt; to populate available subscriptions, then select your default.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/grafana/data-sources/screenshot-managed-identity-2.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/grafana/data-sources/screenshot-managed-identity-2.png&#34;data-srcset=&#34;/media/docs/grafana/data-sources/screenshot-managed-identity-2.png?w=320 320w, /media/docs/grafana/data-sources/screenshot-managed-identity-2.png?w=550 550w, /media/docs/grafana/data-sources/screenshot-managed-identity-2.png?w=750 750w, /media/docs/grafana/data-sources/screenshot-managed-identity-2.png?w=900 900w, /media/docs/grafana/data-sources/screenshot-managed-identity-2.png?w=1040 1040w, /media/docs/grafana/data-sources/screenshot-managed-identity-2.png?w=1240 1240w, /media/docs/grafana/data-sources/screenshot-managed-identity-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Azure Monitor data source configured with Managed Identity&#34;width=&#34;2449&#34;height=&#34;1306&#34;title=&#34;Azure Monitor data source configured with Managed Identity&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/data-sources/screenshot-managed-identity-2.png&#34;
            alt=&#34;Azure Monitor data source configured with Managed Identity&#34;width=&#34;2449&#34;height=&#34;1306&#34;title=&#34;Azure Monitor data source configured with Managed Identity&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Azure Monitor data source configured with Managed Identity&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h4 id=&#34;provision-managed-identity-with-yaml&#34;&gt;Provision Managed Identity with YAML&lt;/h4&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: 1

datasources:
  - name: Azure Monitor
    type: grafana-azure-monitor-datasource
    access: proxy
    jsonData:
      azureAuthType: msi
      subscriptionId: &amp;lt;subscription-id&amp;gt; # Optional, default subscription
    version: 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;workload-identity&#34;&gt;Workload Identity&lt;/h3&gt;
&lt;p&gt;Use Azure Workload Identity for secure authentication in Kubernetes environments like AKS.&lt;/p&gt;
&lt;h4 id=&#34;workload-identity-prerequisites&#34;&gt;Workload Identity prerequisites&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Grafana must be running in a Kubernetes environment with workload identity federation configured.&lt;/li&gt;
&lt;li&gt;The workload identity must have the &lt;code&gt;Reader&lt;/code&gt; role on the subscription or resources you want to monitor.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;https://azure.github.io/azure-workload-identity/docs/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure workload identity documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;workload-identity-grafana-server-configuration&#34;&gt;Workload Identity Grafana server configuration&lt;/h4&gt;
&lt;p&gt;Enable workload identity in the Grafana server configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[azure]
workload_identity_enabled = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Optional configuration variables:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[azure]
workload_identity_enabled = true
workload_identity_tenant_id = &amp;lt;IDENTITY_TENANT_ID&amp;gt;    # Microsoft Entra ID tenant containing the managed identity
workload_identity_client_id = &amp;lt;IDENTITY_CLIENT_ID&amp;gt;    # Client ID if different from default
workload_identity_token_file = &amp;lt;TOKEN_FILE_PATH&amp;gt;      # Path to the token file&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#azure&#34;&gt;Grafana Azure configuration&lt;/a&gt; and the &lt;a href=&#34;https://azure.github.io/azure-workload-identity/docs/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure workload identity documentation&lt;/a&gt; for more details.&lt;/p&gt;
&lt;h4 id=&#34;workload-identity-ui-configuration&#34;&gt;Workload Identity UI configuration&lt;/h4&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Authentication&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Select &lt;strong&gt;Workload Identity&lt;/strong&gt;. The directory ID, application ID, and client secret fields are hidden.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default Subscription&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Click &lt;strong&gt;Load Subscriptions&lt;/strong&gt; to populate available subscriptions, then select your default.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/grafana/data-sources/screenshot-workload-identity.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/grafana/data-sources/screenshot-workload-identity.png&#34;data-srcset=&#34;/media/docs/grafana/data-sources/screenshot-workload-identity.png?w=320 320w, /media/docs/grafana/data-sources/screenshot-workload-identity.png?w=550 550w, /media/docs/grafana/data-sources/screenshot-workload-identity.png?w=750 750w, /media/docs/grafana/data-sources/screenshot-workload-identity.png?w=900 900w, /media/docs/grafana/data-sources/screenshot-workload-identity.png?w=1040 1040w, /media/docs/grafana/data-sources/screenshot-workload-identity.png?w=1240 1240w, /media/docs/grafana/data-sources/screenshot-workload-identity.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Azure Monitor data source configured with Workload Identity&#34;width=&#34;2462&#34;height=&#34;1306&#34;title=&#34;Azure Monitor data source configured with Workload Identity&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/data-sources/screenshot-workload-identity.png&#34;
            alt=&#34;Azure Monitor data source configured with Workload Identity&#34;width=&#34;2462&#34;height=&#34;1306&#34;title=&#34;Azure Monitor data source configured with Workload Identity&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Azure Monitor data source configured with Workload Identity&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h4 id=&#34;provision-workload-identity-with-yaml&#34;&gt;Provision Workload Identity with YAML&lt;/h4&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: 1

datasources:
  - name: Azure Monitor
    type: grafana-azure-monitor-datasource
    access: proxy
    jsonData:
      azureAuthType: workloadidentity
      subscriptionId: &amp;lt;subscription-id&amp;gt; # Optional, default subscription
    version: 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;current-user&#34;&gt;Current User&lt;/h3&gt;
&lt;p&gt;Forward the logged-in Grafana user&amp;rsquo;s Azure credentials to the data source for user-level access control.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Current User authentication is an &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;experimental feature&lt;/a&gt;. Engineering and on-call support is not available. Documentation is limited. No SLA is provided. Contact Grafana Support to enable this feature in Grafana Cloud.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;current-user-prerequisites&#34;&gt;Current User prerequisites&lt;/h4&gt;
&lt;p&gt;Your Grafana instance must be configured with Microsoft Entra ID authentication. Refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-security/configure-authentication/azuread/&#34;&gt;Microsoft Entra ID authentication documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;configure-your-azure-app-registration&#34;&gt;Configure your Azure App Registration&lt;/h4&gt;
&lt;p&gt;The App Registration used for Grafana login requires additional configuration:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enable token issuance:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the Azure Portal, open your App Registration.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Authentication&lt;/strong&gt; in the side menu.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Implicit grant and hybrid flows&lt;/strong&gt;, check both &lt;strong&gt;Access tokens&lt;/strong&gt; and &lt;strong&gt;ID tokens&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Save your changes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Add API permissions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the Azure Portal, open your App Registration.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;API Permissions&lt;/strong&gt; in the side menu.&lt;/li&gt;
&lt;li&gt;Ensure these permissions are present under &lt;strong&gt;Microsoft Graph&lt;/strong&gt;: &lt;code&gt;openid&lt;/code&gt;, &lt;code&gt;profile&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt;, and &lt;code&gt;offline_access&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add the following permissions:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Azure Service Management&lt;/strong&gt; &amp;gt; &lt;strong&gt;Delegated permissions&lt;/strong&gt; &amp;gt; &lt;code&gt;user_impersonation&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;APIs my organization uses&lt;/strong&gt; &amp;gt; Search for &lt;strong&gt;Log Analytics API&lt;/strong&gt; &amp;gt; &lt;strong&gt;Delegated permissions&lt;/strong&gt; &amp;gt; &lt;code&gt;Data.Read&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Refer to the &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-configure-app-access-web-apis&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update Grafana scopes:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Update the &lt;code&gt;scopes&lt;/code&gt; section in your Grafana Azure authentication configuration to include the &lt;code&gt;.default&lt;/code&gt; scope:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;.default openid email profile&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;current-user-grafana-server-configuration&#34;&gt;Current User Grafana server configuration&lt;/h4&gt;
&lt;p&gt;Enable current user authentication in the Grafana server configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[azure]
user_identity_enabled = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;By default, this also enables fallback service credentials. To disable fallback credentials at the instance level:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[azure]
user_identity_enabled = true
user_identity_fallback_credentials_enabled = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;To use fallback service credentials, the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#feature_toggles&#34;&gt;feature toggle&lt;/a&gt; &lt;code&gt;idForwarding&lt;/code&gt; must be set to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;limitations-and-fallback-credentials&#34;&gt;Limitations and fallback credentials&lt;/h4&gt;
&lt;p&gt;Current User authentication doesn&amp;rsquo;t support backend functionality like alerting, reporting, and recorded queries because user credentials aren&amp;rsquo;t available for background operations.&lt;/p&gt;
&lt;p&gt;To support these features, configure &lt;strong&gt;fallback service credentials&lt;/strong&gt;. When enabled, Grafana uses the fallback credentials for backend operations. Note that operations using fallback credentials are limited to the permissions of those credentials, not the user&amp;rsquo;s permissions.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Query and resource caching is disabled by default for data sources using Current User authentication.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;current-user-ui-configuration&#34;&gt;Current User UI configuration&lt;/h4&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Authentication&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Select &lt;strong&gt;Current User&lt;/strong&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default Subscription&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Click &lt;strong&gt;Load Subscriptions&lt;/strong&gt; to populate available subscriptions, then select your default.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Fallback Service Credentials&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enable and configure credentials for backend features like alerting.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/grafana/data-sources/screenshot-current-user.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/grafana/data-sources/screenshot-current-user.png&#34;data-srcset=&#34;/media/docs/grafana/data-sources/screenshot-current-user.png?w=320 320w, /media/docs/grafana/data-sources/screenshot-current-user.png?w=550 550w, /media/docs/grafana/data-sources/screenshot-current-user.png?w=750 750w, /media/docs/grafana/data-sources/screenshot-current-user.png?w=900 900w, /media/docs/grafana/data-sources/screenshot-current-user.png?w=1040 1040w, /media/docs/grafana/data-sources/screenshot-current-user.png?w=1240 1240w, /media/docs/grafana/data-sources/screenshot-current-user.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Azure Monitor data source configured with Current User authentication&#34;width=&#34;2994&#34;height=&#34;1464&#34;title=&#34;Azure Monitor data source configured with Current User authentication&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/data-sources/screenshot-current-user.png&#34;
            alt=&#34;Azure Monitor data source configured with Current User authentication&#34;width=&#34;2994&#34;height=&#34;1464&#34;title=&#34;Azure Monitor data source configured with Current User authentication&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Azure Monitor data source configured with Current User authentication&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h4 id=&#34;provision-current-user-with-yaml&#34;&gt;Provision Current User with YAML&lt;/h4&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The &lt;code&gt;oauthPassThru&lt;/code&gt; property is required for Current User authentication. The &lt;code&gt;disableGrafanaCache&lt;/code&gt; property prevents returning cached responses for resources users don&amp;rsquo;t have access to.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;


&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: 1

datasources:
  - name: Azure Monitor
    type: grafana-azure-monitor-datasource
    access: proxy
    jsonData:
      azureAuthType: currentuser
      oauthPassThru: true
      disableGrafanaCache: true
      subscriptionId: &amp;lt;subscription-id&amp;gt; # Optional, default subscription
    version: 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;additional-configuration-options&#34;&gt;Additional configuration options&lt;/h2&gt;
&lt;p&gt;These settings apply to all authentication methods.&lt;/p&gt;
&lt;h3 id=&#34;general-settings&#34;&gt;General settings&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The data source name used in panels and queries. Example: &lt;code&gt;azure-monitor-prod&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggle to make this the default data source for new panels.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;enable-basic-logs&#34;&gt;Enable Basic Logs&lt;/h3&gt;
&lt;p&gt;Toggle &lt;strong&gt;Enable Basic Logs&lt;/strong&gt; to allow queries against &lt;a href=&#34;https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Basic Logs tables&lt;/a&gt; in supported Log Analytics Workspaces.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Querying Basic Logs tables incurs additional costs on a per-query basis.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;private-data-source-connect-grafana-cloud-only&#34;&gt;Private data source connect (Grafana Cloud only)&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re using Grafana Cloud and need to connect to Azure resources in a private network, use Private Data Source Connect (PDC).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click the &lt;strong&gt;Private data source connect&lt;/strong&gt; dropdown to select your PDC configuration.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Manage private data source connect&lt;/strong&gt; to view your PDC connection details.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more information, refer to &lt;a href=&#34;docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/&#34;&gt;Private data source connect&lt;/a&gt; and &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/configure-pdc/#configure-grafana-private-data-source-connect-pdc&#34;&gt;Configure PDC&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;supported-cloud-names&#34;&gt;Supported cloud names&lt;/h2&gt;
&lt;p&gt;When provisioning the data source, use the following &lt;code&gt;cloudName&lt;/code&gt; values:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Azure Cloud&lt;/th&gt;
              &lt;th&gt;&lt;code&gt;cloudName&lt;/code&gt; value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Microsoft Azure public cloud&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;azuremonitor&lt;/code&gt; (default)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Microsoft Chinese national cloud&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;chinaazuremonitor&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;US Government cloud&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;govazuremonitor&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;For Current User authentication, the cloud names differ: use &lt;code&gt;AzureCloud&lt;/code&gt; for public cloud, &lt;code&gt;AzureChinaCloud&lt;/code&gt; for the Chinese national cloud, and &lt;code&gt;AzureUSGovernment&lt;/code&gt; for the US Government cloud.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;verify-the-connection&#34;&gt;Verify the connection&lt;/h2&gt;
&lt;p&gt;After configuring the data source, click &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt;. A successful connection displays a message confirming that the credentials are valid and have access to the configured default subscription.&lt;/p&gt;
&lt;p&gt;If the test fails, verify:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Your credentials are correct (tenant ID, client ID, client secret)&lt;/li&gt;
&lt;li&gt;The identity has the required Azure RBAC permissions&lt;/li&gt;
&lt;li&gt;For Managed Identity or Workload Identity, that the Grafana server configuration is correct&lt;/li&gt;
&lt;li&gt;Network connectivity to Azure endpoints&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h2&gt;
&lt;p&gt;You can define and configure the Azure Monitor data source in YAML files as part of the Grafana provisioning system.
For more information about provisioning, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;provision-quick-reference&#34;&gt;Provision quick reference&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Authentication method&lt;/th&gt;
              &lt;th&gt;&lt;code&gt;azureAuthType&lt;/code&gt; value&lt;/th&gt;
              &lt;th&gt;Required fields&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;App Registration&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;clientsecret&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;tenantId&lt;/code&gt;, &lt;code&gt;clientId&lt;/code&gt;, &lt;code&gt;clientSecret&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Managed Identity&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;msi&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;None (uses VM identity)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Workload Identity&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;workloadidentity&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;None (uses pod identity)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Current User&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;currentuser&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;oauthPassThru: true&lt;/code&gt;, &lt;code&gt;disableGrafanaCache: true&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;All methods support the optional &lt;code&gt;subscriptionId&lt;/code&gt; field to set a default subscription.&lt;/p&gt;
&lt;p&gt;For complete YAML examples, see the &lt;a href=&#34;#configure-authentication&#34;&gt;authentication method sections&lt;/a&gt; above.&lt;/p&gt;
&lt;h2 id=&#34;configure-with-terraform&#34;&gt;Configure with Terraform&lt;/h2&gt;
&lt;p&gt;You can configure the Azure Monitor data source using the &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Terraform provider&lt;/a&gt;. This approach enables infrastructure-as-code workflows and version control for your Grafana configuration.&lt;/p&gt;
&lt;h3 id=&#34;terraform-prerequisites&#34;&gt;Terraform prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.terraform.io/downloads&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Terraform&lt;/a&gt; installed&lt;/li&gt;
&lt;li&gt;Grafana Terraform provider configured with appropriate credentials&lt;/li&gt;
&lt;li&gt;For Grafana Cloud: A &lt;a href=&#34;/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/&#34;&gt;Cloud Access Policy token&lt;/a&gt; with data source permissions&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;provider-configuration&#34;&gt;Provider configuration&lt;/h3&gt;
&lt;p&gt;Configure the Grafana provider to connect to your Grafana instance:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;hcl&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-hcl&#34;&gt;terraform {
  required_providers {
    grafana = {
      source  = &amp;#34;grafana/grafana&amp;#34;
      version = &amp;#34;&amp;gt;= 2.0.0&amp;#34;
    }
  }
}

# For Grafana Cloud
provider &amp;#34;grafana&amp;#34; {
  url  = &amp;#34;&amp;lt;YOUR_GRAFANA_CLOUD_STACK_URL&amp;gt;&amp;#34;
  auth = &amp;#34;&amp;lt;YOUR_SERVICE_ACCOUNT_TOKEN&amp;gt;&amp;#34;
}

# For self-hosted Grafana
# provider &amp;#34;grafana&amp;#34; {
#   url  = &amp;#34;http://localhost:3000&amp;#34;
#   auth = &amp;#34;&amp;lt;API_KEY_OR_SERVICE_ACCOUNT_TOKEN&amp;gt;&amp;#34;
# }&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;terraform-examples&#34;&gt;Terraform examples&lt;/h3&gt;
&lt;p&gt;The following examples show how to configure the Azure Monitor data source for each authentication method.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;App Registration (client secret):&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;hcl&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-hcl&#34;&gt;resource &amp;#34;grafana_data_source&amp;#34; &amp;#34;azure_monitor&amp;#34; {
  type = &amp;#34;grafana-azure-monitor-datasource&amp;#34;
  name = &amp;#34;Azure Monitor&amp;#34;

  json_data_encoded = jsonencode({
    azureAuthType  = &amp;#34;clientsecret&amp;#34;
    cloudName      = &amp;#34;azuremonitor&amp;#34;
    tenantId       = &amp;#34;&amp;lt;TENANT_ID&amp;gt;&amp;#34;
    clientId       = &amp;#34;&amp;lt;CLIENT_ID&amp;gt;&amp;#34;
    subscriptionId = &amp;#34;&amp;lt;SUBSCRIPTION_ID&amp;gt;&amp;#34;
  })

  secure_json_data_encoded = jsonencode({
    clientSecret = &amp;#34;&amp;lt;CLIENT_SECRET&amp;gt;&amp;#34;
  })
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Managed Identity:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;hcl&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-hcl&#34;&gt;resource &amp;#34;grafana_data_source&amp;#34; &amp;#34;azure_monitor&amp;#34; {
  type = &amp;#34;grafana-azure-monitor-datasource&amp;#34;
  name = &amp;#34;Azure Monitor&amp;#34;

  json_data_encoded = jsonencode({
    azureAuthType  = &amp;#34;msi&amp;#34;
    subscriptionId = &amp;#34;&amp;lt;SUBSCRIPTION_ID&amp;gt;&amp;#34;
  })
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Workload Identity:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;hcl&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-hcl&#34;&gt;resource &amp;#34;grafana_data_source&amp;#34; &amp;#34;azure_monitor&amp;#34; {
  type = &amp;#34;grafana-azure-monitor-datasource&amp;#34;
  name = &amp;#34;Azure Monitor&amp;#34;

  json_data_encoded = jsonencode({
    azureAuthType  = &amp;#34;workloadidentity&amp;#34;
    subscriptionId = &amp;#34;&amp;lt;SUBSCRIPTION_ID&amp;gt;&amp;#34;
  })
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Current User:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;hcl&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-hcl&#34;&gt;resource &amp;#34;grafana_data_source&amp;#34; &amp;#34;azure_monitor&amp;#34; {
  type = &amp;#34;grafana-azure-monitor-datasource&amp;#34;
  name = &amp;#34;Azure Monitor&amp;#34;

  json_data_encoded = jsonencode({
    azureAuthType       = &amp;#34;currentuser&amp;#34;
    oauthPassThru       = true
    disableGrafanaCache = true
    subscriptionId      = &amp;#34;&amp;lt;SUBSCRIPTION_ID&amp;gt;&amp;#34;
  })
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;With Basic Logs enabled:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Add &lt;code&gt;enableBasicLogs = true&lt;/code&gt; to any of the above configurations:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;hcl&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-hcl&#34;&gt;resource &amp;#34;grafana_data_source&amp;#34; &amp;#34;azure_monitor&amp;#34; {
  type = &amp;#34;grafana-azure-monitor-datasource&amp;#34;
  name = &amp;#34;Azure Monitor&amp;#34;

  json_data_encoded = jsonencode({
    azureAuthType   = &amp;#34;clientsecret&amp;#34;
    cloudName       = &amp;#34;azuremonitor&amp;#34;
    tenantId        = &amp;#34;&amp;lt;TENANT_ID&amp;gt;&amp;#34;
    clientId        = &amp;#34;&amp;lt;CLIENT_ID&amp;gt;&amp;#34;
    subscriptionId  = &amp;#34;&amp;lt;SUBSCRIPTION_ID&amp;gt;&amp;#34;
    enableBasicLogs = true
  })

  secure_json_data_encoded = jsonencode({
    clientSecret = &amp;#34;&amp;lt;CLIENT_SECRET&amp;gt;&amp;#34;
  })
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For more information about the Grafana Terraform provider, refer to the &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;provider documentation&lt;/a&gt; and the &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/data_source&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;grafana_data_source resource&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-the-azure-monitor-data-source">Configure the Azure Monitor data source&lt;/h1>
&lt;p>This document explains how to configure the Azure Monitor data source and the available configuration options.
For general information about data sources, refer to
&lt;a href="/docs/grafana/v12.4/datasources/">Grafana data sources&lt;/a> and
&lt;a href="/docs/grafana/v12.4/administration/data-source-management/">Data source management&lt;/a>.&lt;/p></description></item><item><title>Azure Monitor query editor</title><link>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/query-editor/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/query-editor/</guid><content><![CDATA[&lt;h1 id=&#34;azure-monitor-query-editor&#34;&gt;Azure Monitor query editor&lt;/h1&gt;
&lt;p&gt;Grafana provides a query editor for the Azure Monitor data source, which is located on the 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/&#34;&gt;Explore page&lt;/a&gt;. You can also access the Azure Monitor query editor from a dashboard panel. Click the menu in the upper right of the panel and select &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This document explains querying specific to the Azure Monitor data source.
For general documentation on querying data sources in Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Azure Monitor data source can query data from Azure Monitor Metrics and Logs, the Azure Resource Graph, and Application Insights Traces. Each source has its own specialized query editor.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ensure you have 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/configure/&#34;&gt;configured the Azure Monitor data source&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Verify your credentials have appropriate permissions for the resources you want to query.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;key-concepts&#34;&gt;Key concepts&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;re new to Azure Monitor, here are some key terms used throughout this documentation:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Term&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;KQL (Kusto Query Language)&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The query language used for Azure Monitor Logs and Azure Resource Graph. KQL uses a pipe-based syntax similar to Unix commands and is optimized for read-only data exploration. If you know SQL, the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/sqlcheatsheet&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SQL to Kusto cheat sheet&lt;/a&gt; can help you get started.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Log Analytics workspace&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;An Azure resource that collects and stores log data from your Azure resources, applications, and services. You query this data using KQL.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Application Insights&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Azure&amp;rsquo;s application performance monitoring (APM) service. It collects telemetry data like requests, exceptions, and traces from your applications.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Metrics vs. Logs&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;Metrics&lt;/strong&gt; are lightweight numeric values collected at regular intervals (e.g., CPU percentage). &lt;strong&gt;Logs&lt;/strong&gt; are detailed records of events with varying schemas (e.g., request logs, error messages). Metrics use a visual query builder; Logs require KQL.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;choose-a-query-editor-mode&#34;&gt;Choose a query editor mode&lt;/h2&gt;
&lt;p&gt;The Azure Monitor data source&amp;rsquo;s query editor has four modes depending on which Azure service you want to query:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Metrics&lt;/strong&gt; for &lt;a href=&#34;#query-azure-monitor-metrics&#34;&gt;Azure Monitor Metrics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logs&lt;/strong&gt; for &lt;a href=&#34;#query-azure-monitor-logs&#34;&gt;Azure Monitor Logs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Traces&lt;/strong&gt; for &lt;a href=&#34;#query-application-insights-traces&#34;&gt;Application Insights Traces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Azure Resource Graph&lt;/strong&gt; for &lt;a href=&#34;#query-azure-resource-graph&#34;&gt;Azure Resource Graph&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;query-azure-monitor-metrics&#34;&gt;Query Azure Monitor Metrics&lt;/h2&gt;
&lt;p&gt;Azure Monitor Metrics collects numeric data from &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/azure-monitor/monitor-reference&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;supported resources&lt;/a&gt;, and you can query them to investigate your resources&amp;rsquo; health and usage and maximize availability and performance.&lt;/p&gt;
&lt;p&gt;Monitor Metrics use a lightweight format that stores only numeric data in a specific structure and supports near real-time scenarios, making it useful for fast detection of issues.
In contrast, Azure Monitor Logs can store a variety of data types, each with their own structure.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/azure-monitor/query-editor-metrics.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/azure-monitor/query-editor-metrics.png&#34;data-srcset=&#34;/static/img/docs/azure-monitor/query-editor-metrics.png?w=320 320w, /static/img/docs/azure-monitor/query-editor-metrics.png?w=550 550w, /static/img/docs/azure-monitor/query-editor-metrics.png?w=750 750w, /static/img/docs/azure-monitor/query-editor-metrics.png?w=900 900w, /static/img/docs/azure-monitor/query-editor-metrics.png?w=1040 1040w, /static/img/docs/azure-monitor/query-editor-metrics.png?w=1240 1240w, /static/img/docs/azure-monitor/query-editor-metrics.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Azure Monitor Metrics sample query visualizing CPU percentage over time&#34;width=&#34;1272&#34;height=&#34;916&#34;title=&#34;Azure Monitor Metrics sample query visualizing CPU percentage over time&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/azure-monitor/query-editor-metrics.png&#34;
            alt=&#34;Azure Monitor Metrics sample query visualizing CPU percentage over time&#34;width=&#34;1272&#34;height=&#34;916&#34;title=&#34;Azure Monitor Metrics sample query visualizing CPU percentage over time&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Azure Monitor Metrics sample query visualizing CPU percentage over time&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;create-a-metrics-query&#34;&gt;Create a Metrics query&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;To create a Metrics query:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In a Grafana panel, select the &lt;strong&gt;Azure Monitor&lt;/strong&gt; data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Metrics&lt;/strong&gt; service.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a resource from which to query metrics by using the subscription, resource group, resource type, and resource fields. Multiple resources can also be selected as long as they belong to the same subscription, region and resource type. Note that only a limited amount of resource types support this feature.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To select a different namespace than the default—for instance, to select resources like storage accounts that are organized under multiple namespaces—use the &lt;strong&gt;Namespace&lt;/strong&gt; option.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Not all metrics returned by the Azure Monitor Metrics API have values.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;The data source retrieves lists of supported metrics for each subscription and ignores metrics that never have values.&lt;/p&gt;&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a metric from the &lt;strong&gt;Metric&lt;/strong&gt; field.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Optionally, you can apply further aggregations or filter by dimensions.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Change the aggregation from the default average to show minimum, maximum, or total values.&lt;/li&gt;
&lt;li&gt;Specify a custom time grain. By default, Grafana selects a time grain interval for you based on your selected time range.&lt;/li&gt;
&lt;li&gt;For metrics with multiple dimensions, you can split and filter the returned metrics.
For example, the Application Insights dependency calls metric supports returning multiple time series for successful and unsuccessful calls.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/azure-monitor/query-editor-metrics-dimensions.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/azure-monitor/query-editor-metrics-dimensions.png&#34;data-srcset=&#34;/static/img/docs/azure-monitor/query-editor-metrics-dimensions.png?w=320 320w, /static/img/docs/azure-monitor/query-editor-metrics-dimensions.png?w=550 550w, /static/img/docs/azure-monitor/query-editor-metrics-dimensions.png?w=750 750w, /static/img/docs/azure-monitor/query-editor-metrics-dimensions.png?w=900 900w, /static/img/docs/azure-monitor/query-editor-metrics-dimensions.png?w=1040 1040w, /static/img/docs/azure-monitor/query-editor-metrics-dimensions.png?w=1240 1240w, /static/img/docs/azure-monitor/query-editor-metrics-dimensions.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Azure Monitor Metrics screenshot showing Dimensions&#34;width=&#34;920&#34;height=&#34;329&#34;title=&#34;Azure Monitor Metrics screenshot showing Dimensions&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/azure-monitor/query-editor-metrics-dimensions.png&#34;
            alt=&#34;Azure Monitor Metrics screenshot showing Dimensions&#34;width=&#34;920&#34;height=&#34;329&#34;title=&#34;Azure Monitor Metrics screenshot showing Dimensions&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Azure Monitor Metrics screenshot showing Dimensions&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The available options change depending on what is relevant to the selected metric.&lt;/p&gt;
&lt;p&gt;You can also augment queries by using 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/template-variables/&#34;&gt;template variables&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;format-legend-aliases&#34;&gt;Format legend aliases&lt;/h3&gt;
&lt;p&gt;You can change the legend label for Metrics by using aliases.
In the Legend Format field, you can combine aliases defined below any way you want.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Blob Type: {{ blobtype }}&lt;/code&gt; becomes &lt;code&gt;Blob Type: PageBlob&lt;/code&gt;, &lt;code&gt;Blob Type: BlockBlob&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{{ resourcegroup }} - {{ resourcename }}&lt;/code&gt; becomes &lt;code&gt;production - web_server&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Alias pattern&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{ subscriptionid }}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Replaced with the subscription ID.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{ subscription }}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Replaced with the subscription name.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{ resourcegroup }}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Replaced with the resource group.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{ namespace }}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Replaced with the resource type or namespace, such as &lt;code&gt;Microsoft.Compute/virtualMachines&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{ resourcename }}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Replaced with the resource name.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{ metric }}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Replaced with the metric name, such as &amp;ldquo;Percentage CPU&amp;rdquo;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;em&gt;&lt;code&gt;{{ arbitraryDimensionID }}&lt;/code&gt;&lt;/em&gt;&lt;/td&gt;
              &lt;td&gt;Replaced with the value of the specified dimension. For example, &lt;code&gt;{{ blobtype }}&lt;/code&gt; becomes &lt;code&gt;BlockBlob&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{ dimensionname }}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Legacy for backward compatibility)&lt;/em&gt; Replaced with the name of the first dimension.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{ dimensionvalue }}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Legacy for backward compatibility)&lt;/em&gt; Replaced with the value of the first dimension.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;filter-with-dimensions&#34;&gt;Filter with dimensions&lt;/h3&gt;
&lt;p&gt;Some metrics also have dimensions, which associate additional metadata.
Dimensions are represented as key-value pairs assigned to each value of a metric.
Grafana can display and filter metrics based on dimension values.&lt;/p&gt;
&lt;p&gt;The data source supports the &lt;code&gt;equals&lt;/code&gt;, &lt;code&gt;not equals&lt;/code&gt;, and &lt;code&gt;starts with&lt;/code&gt; operators as detailed in the &lt;a href=&#34;https://docs.microsoft.com/en-us/rest/api/monitor/metrics/list&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Monitor Metrics API documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For more information on multi-dimensional metrics, refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/data-platform-metrics#multi-dimensional-metrics&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure Monitor data platform metrics documentation&lt;/a&gt; and &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/metrics-charts#filters&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure Monitor filtering documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;query-azure-monitor-logs&#34;&gt;Query Azure Monitor Logs&lt;/h2&gt;
&lt;p&gt;Azure Monitor Logs collects and organizes log and performance data from &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/azure-monitor/monitor-reference&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;supported resources&lt;/a&gt;, and makes many sources of data available to query together with the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Kusto Query Language (KQL)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;While Azure Monitor Metrics stores only simplified numerical data, Logs can store different data types, each with their own structure.
You can also perform complex analysis of Logs data by using KQL.&lt;/p&gt;
&lt;p&gt;The Azure Monitor data source also supports querying of &lt;a href=&#34;https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Basic Logs&lt;/a&gt; tables (if they exist in your Log Analytics workspace). This feature must be enabled in the data source configuration.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/azure-monitor/query-editor-logs.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/azure-monitor/query-editor-logs.png&#34;data-srcset=&#34;/static/img/docs/azure-monitor/query-editor-logs.png?w=320 320w, /static/img/docs/azure-monitor/query-editor-logs.png?w=550 550w, /static/img/docs/azure-monitor/query-editor-logs.png?w=750 750w, /static/img/docs/azure-monitor/query-editor-logs.png?w=900 900w, /static/img/docs/azure-monitor/query-editor-logs.png?w=1040 1040w, /static/img/docs/azure-monitor/query-editor-logs.png?w=1240 1240w, /static/img/docs/azure-monitor/query-editor-logs.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Azure Monitor Logs sample query comparing successful requests to failed requests&#34;width=&#34;1272&#34;height=&#34;939&#34;title=&#34;Azure Monitor Logs sample query comparing successful requests to failed requests&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/azure-monitor/query-editor-logs.png&#34;
            alt=&#34;Azure Monitor Logs sample query comparing successful requests to failed requests&#34;width=&#34;1272&#34;height=&#34;939&#34;title=&#34;Azure Monitor Logs sample query comparing successful requests to failed requests&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Azure Monitor Logs sample query comparing successful requests to failed requests&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;logs-query-builder-public-preview&#34;&gt;Logs query builder (public preview)&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The Logs query builder is a &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;public preview feature&lt;/a&gt;. It may not be enabled in all Grafana environments.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The Logs query builder provides a visual interface for building Azure Monitor Logs queries without writing KQL. This is helpful if you&amp;rsquo;re new to KQL or want to quickly build simple queries.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To enable the Logs query builder:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enable the &lt;code&gt;azureMonitorLogsBuilderEditor&lt;/code&gt; 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/feature-toggles/&#34;&gt;feature toggle&lt;/a&gt; in your Grafana configuration.&lt;/li&gt;
&lt;li&gt;Restart Grafana for the change to take effect.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;To switch between Builder and Code modes:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When the feature is enabled, a &lt;strong&gt;Builder / Code&lt;/strong&gt; toggle appears in the Logs query editor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Builder&lt;/strong&gt;: Use the visual interface to select tables, columns, filters, and aggregations. The builder generates the KQL query for you.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code&lt;/strong&gt;: Write KQL queries directly. Use this mode for complex queries that require full KQL capabilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;New queries default to Builder mode. Existing queries that were created with raw KQL remain in Code mode.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;You can switch from Builder to Code mode at any time to view or edit the generated KQL. However, switching from Code to Builder mode may not preserve complex queries that can&amp;rsquo;t be represented in the builder interface.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;create-a-logs-query&#34;&gt;Create a Logs query&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;To create a Logs query:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In a Grafana panel, select the &lt;strong&gt;Azure Monitor&lt;/strong&gt; data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Logs&lt;/strong&gt; service.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a resource to query. Multiple resources can be selected as long as they are of the same type.&lt;/p&gt;
&lt;p&gt;Alternatively, you can dynamically query all resources under a single resource group or subscription.


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;If a time span is specified in the query, the overlap between the query time span and the dashboard time range will be used. See the &lt;a href=&#34;https://learn.microsoft.com/en-us/rest/api/loganalytics/dataaccess/query/get?tabs=HTTP#uri-parameters&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;API documentation for
details.&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter your KQL query.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can also augment queries by using 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/template-variables/&#34;&gt;template variables&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To create a Basic Logs query:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Ensure that the data source has the &lt;code&gt;Enable Basic Logs&lt;/code&gt; toggle enabled.&lt;/li&gt;
&lt;li&gt;In a Grafana panel, select the &lt;strong&gt;Azure Monitor&lt;/strong&gt; data source.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Logs&lt;/strong&gt; service.&lt;/li&gt;
&lt;li&gt;Select a resource to query. Multiple resources can be selected as long as they are of the same type.&lt;/li&gt;
&lt;li&gt;Switch the &lt;code&gt;Logs&lt;/code&gt; toggle from &lt;code&gt;Analytics&lt;/code&gt; to &lt;code&gt;Basic&lt;/code&gt;. A modal will display to notify users of potential additional costs.


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Basic Logs queries do not support time-ranges specified in the query. The time-range will be hardcoded to the dashboard time-range. There are also other query limitations. See the
&lt;a href=&#34;https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1#limitations&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;documentation for details.&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Enter your KQL query.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can also augment queries by using 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/template-variables/&#34;&gt;template variables&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;logs-query-examples&#34;&gt;Logs query examples&lt;/h3&gt;
&lt;p&gt;Azure Monitor Logs queries are written using the Kusto Query Language (KQL), a rich language similar to SQL.&lt;/p&gt;
&lt;p&gt;The Azure documentation includes resources to help you learn KQL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.microsoft.com/en-us/azure/azure-monitor/logs/log-query-overview&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Log queries in Azure Monitor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.microsoft.com/en-us/azure/data-explorer/kusto/concepts/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Getting started with Kusto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/tutorial?pivots=azuremonitor&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Tutorial: Use Kusto queries in Azure Monitor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/sqlcheatsheet&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SQL to Kusto cheat sheet&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Time-range:&lt;/strong&gt; The time-range used for the query can be modified via the time-range switch:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Selecting &lt;strong&gt;Query&lt;/strong&gt; uses only time-ranges specified within the query.&lt;/li&gt;
&lt;li&gt;Selecting &lt;strong&gt;Dashboard&lt;/strong&gt; uses only the Grafana dashboard time-range.&lt;/li&gt;
&lt;li&gt;If no time-range is specified in the query, the default Log Analytics time-range applies.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more details, refer to the &lt;a href=&#34;https://learn.microsoft.com/en-us/rest/api/loganalytics/dataaccess/query/get?tabs=HTTP#uri-parameters&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure Monitor Logs API documentation&lt;/a&gt;. If you previously used the &lt;code&gt;Intersection&lt;/code&gt; option, it has been migrated to &lt;code&gt;Dashboard&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;This example query returns a virtual machine&amp;rsquo;s CPU performance, averaged over 5-minute time grains:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;Perf
// $__timeFilter is a special Grafana macro that filters the results to the time span of the dashboard
| where $__timeFilter(TimeGenerated)
| where CounterName == &amp;#34;% Processor Time&amp;#34;
| summarize avg(CounterValue) by bin(TimeGenerated, 5m), Computer
| order by TimeGenerated asc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Use time series queries for values that change over time, usually for graph visualizations such as the Time series panel.
Each query should return at least a datetime column and numeric value column.
The result must also be sorted in ascending order by the datetime column.&lt;/p&gt;
&lt;p&gt;You can also create a query with at least one non-numeric, non-datetime column.
Azure Monitor considers those columns to be dimensions, and they become labels in the response.&lt;/p&gt;
&lt;p&gt;For example, this query returns the aggregated count grouped by hour, Computer, and the CounterName:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;Perf
| where $__timeFilter(TimeGenerated)
| summarize count() by bin(TimeGenerated, 1h), Computer, CounterName
| order by TimeGenerated asc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can also select additional number value columns, with or without multiple dimensions.
For example, this query returns a count and average value by hour, Computer, CounterName, and InstanceName:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;Perf
| where $__timeFilter(TimeGenerated)
| summarize Samples=count(), [&amp;#34;Avg Value&amp;#34;]=avg(CounterValue)
    by bin(TimeGenerated, $__interval), Computer, CounterName, InstanceName
| order by TimeGenerated asc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Use table queries with the Table panel to produce a list of columns and rows.
This query returns rows with the six specified columns:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AzureActivity
| where $__timeFilter()
| project TimeGenerated, ResourceGroup, Category, OperationName, ActivityStatus, Caller
| order by TimeGenerated desc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;use-macros-in-logs-queries&#34;&gt;Use macros in Logs queries&lt;/h3&gt;
&lt;p&gt;To help you write queries, you can use several Grafana macros in the &lt;code&gt;where&lt;/code&gt; clause:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Macro&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFilter()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filters the results to the time range of the dashboard.&lt;br/&gt;Example: &lt;code&gt;TimeGenerated &amp;gt;= datetime(2018-06-05T18:09:58.907Z) and TimeGenerated &amp;lt;= datetime(2018-06-05T20:09:58.907Z)&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFilter(datetimeColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Like &lt;code&gt;$__timeFilter()&lt;/code&gt;, but specifies a custom field to filter on.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFrom()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Expands to the start of the dashboard time range.&lt;br/&gt;Example: &lt;code&gt;datetime(2018-06-05T18:09:58.907Z)&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeTo()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Expands to the end of the dashboard time range.&lt;br/&gt;Example: &lt;code&gt;datetime(2018-06-05T20:09:58.907Z)&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__escapeMulti($myVar)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Escapes illegal characters in multi-value template variables.&lt;br/&gt;If &lt;code&gt;$myVar&lt;/code&gt; has the values &lt;code&gt;&#39;\\grafana-vm\Network(eth0)\Total&#39;,&#39;\\hello!&#39;&lt;/code&gt; as a string, use this to expand it to &lt;code&gt;@&#39;\\grafana-vm\Network(eth0)\Total&#39;, @&#39;\\hello!&#39;&lt;/code&gt;.&lt;br/&gt;&lt;br/&gt;If using single-value variables, escape the variable inline instead: &lt;code&gt;@&#39;\$myVar&#39;&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__contains(colName, $myVar)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Expands multi-value template variables.&lt;br/&gt;If &lt;code&gt;$myVar&lt;/code&gt; has the value &lt;code&gt;&#39;value1&#39;,&#39;value2&#39;&lt;/code&gt;, use this to expand it to &lt;code&gt;colName in (&#39;value1&#39;,&#39;value2&#39;)&lt;/code&gt;.&lt;br/&gt;&lt;br/&gt;If using the &lt;code&gt;All&lt;/code&gt; option, check the &lt;code&gt;Include All Option&lt;/code&gt; checkbox, and type the value &lt;code&gt;all&lt;/code&gt; in the &lt;code&gt;Custom all value&lt;/code&gt; field. If &lt;code&gt;$myVar&lt;/code&gt; has the value &lt;code&gt;all&lt;/code&gt;, the macro instead expands to &lt;code&gt;1 == 1&lt;/code&gt;.&lt;br/&gt;For template variables with many options, this avoids building a large &amp;ldquo;where..in&amp;rdquo; clause, which improves performance.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Additionally, Grafana has the built-in 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/query-transform-data/#query-options&#34;&gt;&lt;code&gt;$__interval&lt;/code&gt; macro&lt;/a&gt;, which calculates an interval in seconds.&lt;/p&gt;
&lt;h2 id=&#34;query-azure-resource-graph&#34;&gt;Query Azure Resource Graph&lt;/h2&gt;
&lt;p&gt;Azure Resource Graph (ARG) is an Azure service designed to extend Azure Resource Management with efficient resource exploration and the ability to query at scale across a set of subscriptions, so that you can more effectively govern an environment.
By querying ARG, you can query resources with complex filtering, iteratively explore resources based on governance requirements, and assess the impact of applying policies in a vast cloud environment.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/azure-monitor/query-editor-arg.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/azure-monitor/query-editor-arg.png&#34;data-srcset=&#34;/static/img/docs/azure-monitor/query-editor-arg.png?w=320 320w, /static/img/docs/azure-monitor/query-editor-arg.png?w=550 550w, /static/img/docs/azure-monitor/query-editor-arg.png?w=750 750w, /static/img/docs/azure-monitor/query-editor-arg.png?w=900 900w, /static/img/docs/azure-monitor/query-editor-arg.png?w=1040 1040w, /static/img/docs/azure-monitor/query-editor-arg.png?w=1240 1240w, /static/img/docs/azure-monitor/query-editor-arg.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Azure Resource Graph sample query listing virtual machines on an account&#34;width=&#34;1272&#34;height=&#34;907&#34;title=&#34;Azure Resource Graph sample query listing virtual machines on an account&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/azure-monitor/query-editor-arg.png&#34;
            alt=&#34;Azure Resource Graph sample query listing virtual machines on an account&#34;width=&#34;1272&#34;height=&#34;907&#34;title=&#34;Azure Resource Graph sample query listing virtual machines on an account&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Azure Resource Graph sample query listing virtual machines on an account&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;create-a-resource-graph-query&#34;&gt;Create a Resource Graph query&lt;/h3&gt;
&lt;p&gt;ARG queries are written in a variant of the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/governance/resource-graph/concepts/query-language&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Kusto Query Language (KQL)&lt;/a&gt;, but not all Kusto language features are available in ARG.&lt;/p&gt;
&lt;p&gt;An Azure Resource Graph query is formatted as table data.&lt;/p&gt;
&lt;p&gt;If your Azure credentials grant you access to multiple subscriptions, you can choose multiple subscriptions before entering queries. It is also possible to run queries against the directory by changing the scope of the query.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Some queries that function at a directory level may not work at a subscription level and vice-versa.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;resource-graph-query-examples&#34;&gt;Resource Graph query examples&lt;/h3&gt;
&lt;p&gt;The Azure documentation also includes &lt;a href=&#34;https://docs.microsoft.com/en-gb/azure/governance/resource-graph/samples/starter&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;sample queries&lt;/a&gt; to help you get started.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sort results by resource properties:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This query returns all resources in the selected subscriptions, but only the name, type, and location properties:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;Resources
| project name, type, location
| order by name asc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This query uses &lt;code&gt;order by&lt;/code&gt; to sort the properties by the &lt;code&gt;name&lt;/code&gt; property in ascending (&lt;code&gt;asc&lt;/code&gt;) order.
You can change which property to sort by and the order (&lt;code&gt;asc&lt;/code&gt; or &lt;code&gt;desc&lt;/code&gt;).
This query uses &lt;code&gt;project&lt;/code&gt; to show only the listed properties in the results.
You can use this to add or remove properties in your queries.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Query resources with complex filtering:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can filter for Azure resources with a tag name and value.&lt;/p&gt;
&lt;p&gt;For example, this query returns a list of resources with an &lt;code&gt;environment&lt;/code&gt; tag value of &lt;code&gt;Internal&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;Resources
| where tags.environment=~&amp;#39;internal&amp;#39;
| project name&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This query uses &lt;code&gt;=~&lt;/code&gt; in the &lt;code&gt;type&lt;/code&gt; match to make the query case-insensitive.
You can also use &lt;code&gt;project&lt;/code&gt; with other properties, or add or remove more.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Group and aggregate the values by property:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can use &lt;code&gt;summarize&lt;/code&gt; and &lt;code&gt;count&lt;/code&gt; to define how to group and aggregate values by property.&lt;/p&gt;
&lt;p&gt;For example, this query returns counts of healthy, unhealthy, and not applicable resources per recommendation:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;securityresources
| where type == &amp;#39;microsoft.security/assessments&amp;#39;
| extend resourceId=id,
    recommendationId=name,
    resourceType=type,
    recommendationName=properties.displayName,
    source=properties.resourceDetails.Source,
    recommendationState=properties.status.code,
    description=properties.metadata.description,
    assessmentType=properties.metadata.assessmentType,
    remediationDescription=properties.metadata.remediationDescription,
    policyDefinitionId=properties.metadata.policyDefinitionId,
    implementationEffort=properties.metadata.implementationEffort,
    recommendationSeverity=properties.metadata.severity,
    category=properties.metadata.categories,
    userImpact=properties.metadata.userImpact,
    threats=properties.metadata.threats,
    portalLink=properties.links.azurePortal
| summarize numberOfResources=count(resourceId) by tostring(recommendationName), tostring(recommendationState)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In ARG, many nested properties (&lt;code&gt;properties.displayName&lt;/code&gt;) are of a &lt;code&gt;dynamic&lt;/code&gt; type and should be cast to a string with &lt;code&gt;tostring()&lt;/code&gt; in order to operate on them.&lt;/p&gt;
&lt;h3 id=&#34;use-macros-in-resource-graph-queries&#34;&gt;Use macros in Resource Graph queries&lt;/h3&gt;
&lt;p&gt;To help you write queries, you can use several Grafana macros in the &lt;code&gt;where&lt;/code&gt; clause:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Macro&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFilter()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Expands to &lt;code&gt;timestamp ≥ datetime(2018-06-05T18:09:58.907Z) and timestamp ≤ datetime(2018-06-05T20:09:58.907Z)&lt;/code&gt;, where the from and to datetimes are from the Grafana time picker.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFilter(datetimeColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Expands to &lt;code&gt;datetimeColumn ≥ datetime(2018-06-05T18:09:58.907Z) and datetimeColumn ≤ datetime(2018-06-05T20:09:58.907Z)&lt;/code&gt;, where the from and to datetimes are from the Grafana time picker.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFrom()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the From datetime from the Grafana picker.&lt;br/&gt;Example: &lt;code&gt;datetime(2018-06-05T18:09:58.907Z)&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeTo()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the To datetime from the Grafana picker.&lt;br/&gt;Example: &lt;code&gt;datetime(2018-06-05T20:09:58.907Z)&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__escapeMulti($myVar)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Escapes illegal characters from multi-value template variables.&lt;br/&gt;If &lt;code&gt;$myVar&lt;/code&gt; has the values &lt;code&gt;&#39;\\grafana-vm\Network(eth0)\Total&#39;,&#39;\\hello!&#39;&lt;/code&gt; as a string, this expands it to &lt;code&gt;@&#39;\\grafana-vm\Network(eth0)\Total&#39;, @&#39;\\hello!&#39;&lt;/code&gt;.&lt;br&gt;If you use single-value variables, escape the variable inline instead: &lt;code&gt;@&#39;\$myVar&#39;&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__contains(colName, $myVar)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Expands multi-value template variables.&lt;br/&gt;If &lt;code&gt;$myVar&lt;/code&gt; has the value &lt;code&gt;&#39;value1&#39;,&#39;value2&#39;&lt;/code&gt;, this expands it to &lt;code&gt;colName in (&#39;value1&#39;,&#39;value2&#39;)&lt;/code&gt;.&lt;br/&gt;If using the &lt;code&gt;All&lt;/code&gt; option, then check the &lt;code&gt;Include All Option&lt;/code&gt; checkbox and in the &lt;code&gt;Custom all value&lt;/code&gt; field type in the following value: &lt;code&gt;all&lt;/code&gt;.&lt;br/&gt;If &lt;code&gt;$myVar&lt;/code&gt; has value &lt;code&gt;all&lt;/code&gt;, this instead expands to &lt;code&gt;1 == 1&lt;/code&gt;.&lt;br/&gt;For template variables with many options, this avoids building a large &amp;ldquo;where..in&amp;rdquo; clause, which improves performance.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;query-application-insights-traces&#34;&gt;Query Application Insights Traces&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview?tabs=net&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure Application Insights&lt;/a&gt; is a service that provides application performance monitoring (APM) features. Application insights can be used to collect metrics, telemetry, and trace logging data.&lt;/p&gt;
&lt;p&gt;Application Insights stores trace data in an underlying Log Analytics workspace and traces can be &lt;a href=&#34;https://learn.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;extended&lt;/a&gt; to provide additional supporting information as required by the application developer.&lt;/p&gt;
&lt;h3 id=&#34;create-a-traces-query&#34;&gt;Create a Traces query&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;To create a Traces query:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In a Grafana panel, select the &lt;strong&gt;Azure Monitor&lt;/strong&gt; data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Traces&lt;/strong&gt; service.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a resource to query. Multiple resources can be selected as long as they are of the same type.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;This query type only supports Application Insights resources.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) Specify an &lt;strong&gt;Operation ID&lt;/strong&gt; value to filter traces.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) Specify &lt;strong&gt;event types&lt;/strong&gt; to filter by.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) Specify &lt;strong&gt;event properties&lt;/strong&gt; to filter by.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) Change the &lt;strong&gt;Result format&lt;/strong&gt; to switch between tabular format and trace format.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Selecting the trace format filters events to only the &lt;code&gt;trace&lt;/code&gt; type. Use this format with the Trace visualization.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Running a query returns all trace data within the time span specified by the panel or dashboard time range.&lt;/p&gt;
&lt;p&gt;You can also augment queries by using 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/template-variables/&#34;&gt;template variables&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-queries-for-alerting-and-recording-rules&#34;&gt;Use queries for alerting and recording rules&lt;/h2&gt;
&lt;p&gt;All Azure Monitor query types (Metrics, Logs, Azure Resource Graph, and Traces) can be used with Grafana Alerting and recording rules.&lt;/p&gt;
&lt;p&gt;For detailed information about creating alert rules, supported query types, authentication requirements, and examples, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/alerting/&#34;&gt;Azure Monitor alerting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;work-with-large-azure-resource-datasets&#34;&gt;Work with large Azure resource datasets&lt;/h2&gt;
&lt;p&gt;If a request exceeds the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/governance/resource-graph/concepts/work-with-data#paging-results&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;maximum allowed value of records&lt;/a&gt;, the result is paginated and only the first page of results are returned.
You can use filters to reduce the amount of records returned under that value.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../template-variables/&#34;&gt;Use template variables&lt;/a&gt; to create dynamic, reusable dashboards&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/annotations/&#34;&gt;Add annotations&lt;/a&gt; to overlay events on your graphs&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/alerting/&#34;&gt;Set up alerting&lt;/a&gt; to create alert rules based on Azure Monitor data&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/troubleshooting/&#34;&gt;Troubleshoot&lt;/a&gt; common query and configuration issues&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="azure-monitor-query-editor">Azure Monitor query editor&lt;/h1>
&lt;p>Grafana provides a query editor for the Azure Monitor data source, which is located on the
&lt;a href="/docs/grafana/v12.4/explore/">Explore page&lt;/a>. You can also access the Azure Monitor query editor from a dashboard panel. Click the menu in the upper right of the panel and select &lt;strong>Edit&lt;/strong>.&lt;/p></description></item><item><title>Azure Monitor template variables</title><link>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/template-variables/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/template-variables/</guid><content><![CDATA[&lt;h1 id=&#34;azure-monitor-template-variables&#34;&gt;Azure Monitor template variables&lt;/h1&gt;
&lt;p&gt;Instead of hard-coding details such as resource group or resource name values in metric queries, you can use variables.
This helps you create more interactive, dynamic, and reusable dashboards.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For an introduction to templating and template variables, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/&#34;&gt;Templating&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/add-template-variables/&#34;&gt;Add and manage variables&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ensure you have 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/configure/&#34;&gt;configured the Azure Monitor data source&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you want template variables to auto-populate subscriptions, set a &lt;strong&gt;Default Subscription&lt;/strong&gt; in the data source configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;create-a-template-variable&#34;&gt;Create a template variable&lt;/h2&gt;
&lt;p&gt;To create a template variable for Azure Monitor:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the dashboard where you want to add the variable.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Dashboard settings&lt;/strong&gt; (gear icon) in the top navigation.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Variables&lt;/strong&gt; in the left menu.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add variable&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter a &lt;strong&gt;Name&lt;/strong&gt; for your variable (e.g., &lt;code&gt;subscription&lt;/code&gt;, &lt;code&gt;resourceGroup&lt;/code&gt;, &lt;code&gt;resource&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Type&lt;/strong&gt; dropdown, select &lt;strong&gt;Query&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Data source&lt;/strong&gt; dropdown, select your Azure Monitor data source.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Query Type&lt;/strong&gt; dropdown, select the appropriate query type (see &lt;a href=&#34;#available-query-types&#34;&gt;Available query types&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Configure any additional fields required by the selected query type.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Run query&lt;/strong&gt; to preview the variable values.&lt;/li&gt;
&lt;li&gt;Configure display options such as &lt;strong&gt;Multi-value&lt;/strong&gt; or &lt;strong&gt;Include All option&lt;/strong&gt; as needed.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Apply&lt;/strong&gt; to save the variable.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;available-query-types&#34;&gt;Available query types&lt;/h2&gt;
&lt;p&gt;The Azure Monitor data source provides the following query types for template variables:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Query type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Subscriptions&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns a list of Azure subscriptions accessible to the configured credentials.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Resource Groups&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns resource groups for a specified subscription. Supports multi-value selection.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Namespaces&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns metric namespaces for the specified subscription. If a resource group is specified, returns only namespaces within that group.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Regions&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns Azure regions available for the specified subscription.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Resource Names&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns resource names for a specified subscription, resource group, and namespace. Supports multi-value selection.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Metric Names&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns available metric names for a specified resource.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Workspaces&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns Log Analytics workspaces for the specified subscription.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Logs&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Executes a KQL query and returns the results as variable values. See &lt;a href=&#34;#create-a-logs-variable&#34;&gt;Create a Logs variable&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Custom Namespaces&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns custom metric namespaces for a specified resource.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Custom Metric Names&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns custom metric names for a specified resource.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Custom metrics cannot be emitted against a subscription or resource group. Select specific resources when retrieving custom metric namespaces or custom metric names.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;create-cascading-variables&#34;&gt;Create cascading variables&lt;/h2&gt;
&lt;p&gt;Cascading variables (also called dependent or chained variables) allow you to create dropdown menus that filter based on previous selections. This is useful for drilling down from subscription to resource group to specific resource.&lt;/p&gt;
&lt;h3 id=&#34;example-subscription--resource-group--resource-name&#34;&gt;Example: Subscription → Resource Group → Resource Name&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Create a Subscription variable&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a variable named &lt;code&gt;subscription&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;Query Type&lt;/strong&gt; to &lt;strong&gt;Subscriptions&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Create a Resource Group variable&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a variable named &lt;code&gt;resourceGroup&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;Query Type&lt;/strong&gt; to &lt;strong&gt;Resource Groups&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Subscription&lt;/strong&gt; field, select &lt;code&gt;$subscription&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Step 3: Create a Resource Name variable&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a variable named &lt;code&gt;resource&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;Query Type&lt;/strong&gt; to &lt;strong&gt;Resource Names&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Subscription&lt;/strong&gt; field, select &lt;code&gt;$subscription&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Resource Group&lt;/strong&gt; field, select &lt;code&gt;$resourceGroup&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Namespace&lt;/strong&gt; for your resources (e.g., &lt;code&gt;Microsoft.Compute/virtualMachines&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now when you change the subscription, the resource group dropdown updates automatically, and when you change the resource group, the resource name dropdown updates.&lt;/p&gt;
&lt;h2 id=&#34;create-a-logs-variable&#34;&gt;Create a Logs variable&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Logs&lt;/strong&gt; query type lets you use a KQL query to populate variable values. The query must return a single column of values.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To create a Logs variable:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new variable with &lt;strong&gt;Query Type&lt;/strong&gt; set to &lt;strong&gt;Logs&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select a &lt;strong&gt;Resource&lt;/strong&gt; (Log Analytics workspace or Application Insights resource).&lt;/li&gt;
&lt;li&gt;Enter a KQL query that returns a single column.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;logs-variable-query-examples&#34;&gt;Logs variable query examples&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Query&lt;/th&gt;
              &lt;th&gt;Returns&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Heartbeat | distinct Computer&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;List of virtual machine names&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Perf | distinct ObjectName&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;List of performance object names&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;AzureActivity | distinct ResourceGroup&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;List of resource groups with activity&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;AppRequests | distinct Name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;List of application request names&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;You can reference other variables in your Logs query:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;workspace(&amp;#34;$workspace&amp;#34;).Heartbeat | distinct Computer&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;workspace(&amp;#34;$workspace&amp;#34;).Perf
| where ObjectName == &amp;#34;$object&amp;#34;
| distinct CounterName&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;variable-refresh-options&#34;&gt;Variable refresh options&lt;/h2&gt;
&lt;p&gt;Control when your variables refresh by setting the &lt;strong&gt;Refresh&lt;/strong&gt; option:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Option&lt;/th&gt;
              &lt;th&gt;Behavior&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;On dashboard load&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Variables refresh each time the dashboard loads. Best for data that changes infrequently.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;On time range change&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Variables refresh when the dashboard time range changes. Use for time-sensitive queries.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;For dashboards with many variables or complex queries, use &lt;strong&gt;On dashboard load&lt;/strong&gt; to improve performance.&lt;/p&gt;
&lt;h2 id=&#34;use-variables-in-queries&#34;&gt;Use variables in queries&lt;/h2&gt;
&lt;p&gt;After you create template variables, you can use them in your Azure Monitor queries by referencing them with the &lt;code&gt;$&lt;/code&gt; prefix.&lt;/p&gt;
&lt;h3 id=&#34;metrics-query-example&#34;&gt;Metrics query example&lt;/h3&gt;
&lt;p&gt;In a Metrics query, select your variables in the resource picker fields:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Subscription&lt;/strong&gt;: &lt;code&gt;$subscription&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource Group&lt;/strong&gt;: &lt;code&gt;$resourceGroup&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource Name&lt;/strong&gt;: &lt;code&gt;$resource&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;logs-query-example&#34;&gt;Logs query example&lt;/h3&gt;
&lt;p&gt;Reference variables directly in your KQL queries:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;Perf
| where ObjectName == &amp;#34;$object&amp;#34; and CounterName == &amp;#34;$metric&amp;#34;
| where TimeGenerated &amp;gt;= $__timeFrom() and TimeGenerated &amp;lt;= $__timeTo()
| where $__contains(Computer, $computer)
| summarize avg(CounterValue) by bin(TimeGenerated, $__interval), Computer
| order by TimeGenerated asc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;multi-value-variables&#34;&gt;Multi-value variables&lt;/h2&gt;
&lt;p&gt;You can enable &lt;strong&gt;Multi-value&lt;/strong&gt; selection for &lt;strong&gt;Resource Groups&lt;/strong&gt; and &lt;strong&gt;Resource Names&lt;/strong&gt; variables. When using multi-value variables in a Metrics query, all selected resources must:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Belong to the same subscription&lt;/li&gt;
&lt;li&gt;Be in the same Azure region&lt;/li&gt;
&lt;li&gt;Be of the same resource type (namespace)&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;When a multi-value variable is used as a parameter in another variable query (for example, to retrieve metric names), only the first selected value is used. Ensure the first resource group and resource name combination is valid.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;troubleshoot-template-variables&#34;&gt;Troubleshoot template variables&lt;/h2&gt;
&lt;p&gt;If you encounter issues with template variables, try the following solutions.&lt;/p&gt;
&lt;h3 id=&#34;variable-returns-no-values&#34;&gt;Variable returns no values&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Verify the Azure Monitor data source is configured correctly and can connect to Azure.&lt;/li&gt;
&lt;li&gt;Check that the credentials have appropriate permissions to list the requested resources.&lt;/li&gt;
&lt;li&gt;For cascading variables, ensure parent variables have valid selections.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;variable-values-are-outdated&#34;&gt;Variable values are outdated&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Check the &lt;strong&gt;Refresh&lt;/strong&gt; setting and adjust if needed.&lt;/li&gt;
&lt;li&gt;Click the refresh icon next to the variable dropdown to manually refresh.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;multi-value-selection-not-working-in-queries&#34;&gt;Multi-value selection not working in queries&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Ensure the resources meet the requirements (same subscription, region, and type).&lt;/li&gt;
&lt;li&gt;For Logs queries, use the &lt;code&gt;$__contains()&lt;/code&gt; macro to handle multi-value variables properly.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="azure-monitor-template-variables">Azure Monitor template variables&lt;/h1>
&lt;p>Instead of hard-coding details such as resource group or resource name values in metric queries, you can use variables.
This helps you create more interactive, dynamic, and reusable dashboards.
Grafana refers to such variables as template variables.&lt;/p></description></item><item><title>Azure Monitor annotations</title><link>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/annotations/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/annotations/</guid><content><![CDATA[&lt;h1 id=&#34;azure-monitor-annotations&#34;&gt;Azure Monitor annotations&lt;/h1&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/build-dashboards/annotate-visualizations/&#34;&gt;Annotations&lt;/a&gt; overlay rich event information on top of graphs. You can use Azure Monitor Log Analytics queries to create annotations that mark important events, deployments, alerts, or other significant occurrences on your dashboards.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ensure you have configured the Azure Monitor data source.&lt;/li&gt;
&lt;li&gt;You need access to a Log Analytics workspace containing the data you want to use for annotations.&lt;/li&gt;
&lt;li&gt;Annotations use Log Analytics (KQL) queries only. Metrics, Traces, and Azure Resource Graph queries are not supported for annotations.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;create-an-annotation-query&#34;&gt;Create an annotation query&lt;/h2&gt;
&lt;p&gt;To add an Azure Monitor annotation to a dashboard:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the dashboard where you want to add annotations.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Dashboard settings&lt;/strong&gt; (gear icon) in the top navigation.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Annotations&lt;/strong&gt; in the left menu.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add annotation query&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter a &lt;strong&gt;Name&lt;/strong&gt; for the annotation (e.g., &amp;ldquo;Azure Activity&amp;rdquo;, &amp;ldquo;Deployments&amp;rdquo;).&lt;/li&gt;
&lt;li&gt;Select your &lt;strong&gt;Azure Monitor&lt;/strong&gt; data source.&lt;/li&gt;
&lt;li&gt;Choose the &lt;strong&gt;Logs&lt;/strong&gt; service.&lt;/li&gt;
&lt;li&gt;Select a &lt;strong&gt;Resource&lt;/strong&gt; (Log Analytics workspace or Application Insights resource).&lt;/li&gt;
&lt;li&gt;Write a KQL query that returns the annotation data.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Apply&lt;/strong&gt; to save.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;query-requirements&#34;&gt;Query requirements&lt;/h2&gt;
&lt;p&gt;Your KQL query should return columns that Grafana can use to create annotations:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Column&lt;/th&gt;
              &lt;th&gt;Required&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;TimeGenerated&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;The timestamp for the annotation. Grafana uses this to position the annotation on the time axis.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Text&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Recommended&lt;/td&gt;
              &lt;td&gt;The annotation text displayed when you hover over or click the annotation.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Additional columns&lt;/td&gt;
              &lt;td&gt;Optional&lt;/td&gt;
              &lt;td&gt;Any other columns returned become annotation tags.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Always include a time filter in your query to limit results to the dashboard&amp;rsquo;s time range. Use the &lt;code&gt;$__timeFilter()&lt;/code&gt; macro.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;annotation-query-examples&#34;&gt;Annotation query examples&lt;/h2&gt;
&lt;p&gt;The following examples demonstrate common annotation use cases.&lt;/p&gt;
&lt;h3 id=&#34;azure-activity-log-events&#34;&gt;Azure Activity Log events&lt;/h3&gt;
&lt;p&gt;Display Azure Activity Log events such as resource modifications, deployments, and administrative actions:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AzureActivity
| where $__timeFilter(TimeGenerated)
| where Level == &amp;#34;Error&amp;#34; or Level == &amp;#34;Warning&amp;#34; or CategoryValue == &amp;#34;Administrative&amp;#34;
| project TimeGenerated, Text=OperationNameValue, Level, ResourceGroup, Caller
| order by TimeGenerated desc
| take 100&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;deployment-events&#34;&gt;Deployment events&lt;/h3&gt;
&lt;p&gt;Show deployment-related activity:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AzureActivity
| where $__timeFilter(TimeGenerated)
| where OperationNameValue contains &amp;#34;deployments&amp;#34;
| project TimeGenerated, Text=strcat(&amp;#34;Deployment: &amp;#34;, OperationNameValue), Status=ActivityStatusValue, ResourceGroup
| order by TimeGenerated desc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;application-insights-exceptions&#34;&gt;Application Insights exceptions&lt;/h3&gt;
&lt;p&gt;Mark application exceptions as annotations:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AppExceptions
| where $__timeFilter(TimeGenerated)
| project TimeGenerated, Text=strcat(ProblemId, &amp;#34;: &amp;#34;, OuterMessage), SeverityLevel, AppRoleName
| order by TimeGenerated desc
| take 50&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;custom-events-from-application-insights&#34;&gt;Custom events from Application Insights&lt;/h3&gt;
&lt;p&gt;Display custom events logged by your application:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AppEvents
| where $__timeFilter(TimeGenerated)
| where Name == &amp;#34;DeploymentStarted&amp;#34; or Name == &amp;#34;DeploymentCompleted&amp;#34;
| project TimeGenerated, Text=Name, AppRoleName
| order by TimeGenerated desc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;security-alerts&#34;&gt;Security alerts&lt;/h3&gt;
&lt;p&gt;Show security-related alerts:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;SecurityAlert
| where $__timeFilter(TimeGenerated)
| project TimeGenerated, Text=AlertName, Severity=AlertSeverity, Description
| order by TimeGenerated desc
| take 50&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;resource-health-events&#34;&gt;Resource health events&lt;/h3&gt;
&lt;p&gt;Display resource health status changes:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AzureActivity
| where $__timeFilter(TimeGenerated)
| where CategoryValue == &amp;#34;ResourceHealth&amp;#34;
| project TimeGenerated, Text=OperationNameValue, Status=ActivityStatusValue, ResourceId
| order by TimeGenerated desc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;vm-start-and-stop-events&#34;&gt;VM start and stop events&lt;/h3&gt;
&lt;p&gt;Mark virtual machine state changes:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AzureActivity
| where $__timeFilter(TimeGenerated)
| where OperationNameValue has_any (&amp;#34;start&amp;#34;, &amp;#34;deallocate&amp;#34;, &amp;#34;restart&amp;#34;)
| where ResourceProviderValue == &amp;#34;MICROSOFT.COMPUTE&amp;#34;
| project TimeGenerated, Text=OperationNameValue, VM=Resource, Status=ActivityStatusValue
| order by TimeGenerated desc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;autoscale-events&#34;&gt;Autoscale events&lt;/h3&gt;
&lt;p&gt;Show autoscale operations:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AzureActivity
| where $__timeFilter(TimeGenerated)
| where OperationNameValue contains &amp;#34;autoscale&amp;#34;
| project TimeGenerated, Text=strcat(&amp;#34;Autoscale: &amp;#34;, OperationNameValue), Status=ActivityStatusValue, ResourceGroup
| order by TimeGenerated desc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;customize-annotation-appearance&#34;&gt;Customize annotation appearance&lt;/h2&gt;
&lt;p&gt;After creating an annotation query, you can customize its appearance:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Color&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Choose a color for the annotation markers. Use different colors to distinguish between annotation types.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Show in&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Select which panels display the annotations.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Add filters to limit when annotations appear.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;p&gt;Follow these recommendations when creating annotations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Limit results&lt;/strong&gt;: Always use &lt;code&gt;take&lt;/code&gt; or &lt;code&gt;limit&lt;/code&gt; to restrict the number of annotations. Too many annotations can clutter your dashboard and impact performance.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use time filters&lt;/strong&gt;: Include &lt;code&gt;$__timeFilter()&lt;/code&gt; to ensure queries only return data within the dashboard&amp;rsquo;s time range.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create meaningful text&lt;/strong&gt;: Use &lt;code&gt;strcat()&lt;/code&gt; or &lt;code&gt;project&lt;/code&gt; to create descriptive annotation text that provides context at a glance.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Add relevant tags&lt;/strong&gt;: Include columns like &lt;code&gt;ResourceGroup&lt;/code&gt;, &lt;code&gt;Severity&lt;/code&gt;, or &lt;code&gt;Status&lt;/code&gt; that become clickable tags for filtering.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use descriptive names&lt;/strong&gt;: Name your annotations clearly (e.g., &amp;ldquo;Production Deployments&amp;rdquo;, &amp;ldquo;Critical Alerts&amp;rdquo;) so dashboard users understand what they represent.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;troubleshoot-annotations&#34;&gt;Troubleshoot annotations&lt;/h2&gt;
&lt;p&gt;If annotations aren&amp;rsquo;t appearing as expected, try the following solutions.&lt;/p&gt;
&lt;h3 id=&#34;annotations-dont-appear&#34;&gt;Annotations don&amp;rsquo;t appear&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Verify the query returns data in the selected time range.&lt;/li&gt;
&lt;li&gt;Check that the query includes a &lt;code&gt;TimeGenerated&lt;/code&gt; column.&lt;/li&gt;
&lt;li&gt;Test the query in the Azure Portal Log Analytics query editor.&lt;/li&gt;
&lt;li&gt;Ensure the annotation is enabled (toggle is on).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;too-many-annotations&#34;&gt;Too many annotations&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Add more specific filters to your query.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;take&lt;/code&gt; to limit results.&lt;/li&gt;
&lt;li&gt;Narrow the time range.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;annotations-appear-at-wrong-times&#34;&gt;Annotations appear at wrong times&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Verify the &lt;code&gt;TimeGenerated&lt;/code&gt; column contains the correct timestamp.&lt;/li&gt;
&lt;li&gt;Check your dashboard&amp;rsquo;s timezone settings.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="azure-monitor-annotations">Azure Monitor annotations&lt;/h1>
&lt;p>
&lt;a href="/docs/grafana/v12.4/dashboards/build-dashboards/annotate-visualizations/">Annotations&lt;/a> overlay rich event information on top of graphs. You can use Azure Monitor Log Analytics queries to create annotations that mark important events, deployments, alerts, or other significant occurrences on your dashboards.&lt;/p></description></item><item><title>Azure Monitor alerting</title><link>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/alerting/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/alerting/</guid><content><![CDATA[&lt;h1 id=&#34;azure-monitor-alerting&#34;&gt;Azure Monitor alerting&lt;/h1&gt;
&lt;p&gt;The Azure Monitor data source supports 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/&#34;&gt;Grafana Alerting&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-recording-rules/create-grafana-managed-recording-rules/&#34;&gt;Grafana-managed recording rules&lt;/a&gt;, allowing you to create alert rules based on Azure metrics, logs, traces, and resource data. You can monitor your Azure environment and receive notifications when specific conditions are met.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ensure you have the appropriate permissions to create alert rules in Grafana.&lt;/li&gt;
&lt;li&gt;Verify your Azure Monitor data source is configured and working correctly.&lt;/li&gt;
&lt;li&gt;Familiarize yourself with 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/&#34;&gt;Grafana Alerting concepts&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Important&lt;/strong&gt;: Verify your data source uses a supported authentication method. Refer to &lt;a href=&#34;#authentication-requirements&#34;&gt;Authentication requirements&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;supported-query-types-for-alerting&#34;&gt;Supported query types for alerting&lt;/h2&gt;
&lt;p&gt;All Azure Monitor query types support alerting and recording rules:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Query type&lt;/th&gt;
              &lt;th&gt;Use case&lt;/th&gt;
              &lt;th&gt;Notes&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metrics&lt;/td&gt;
              &lt;td&gt;Threshold-based alerts on Azure resource metrics&lt;/td&gt;
              &lt;td&gt;Best suited for alerting; returns time-series data&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Logs&lt;/td&gt;
              &lt;td&gt;Alert on log patterns, error counts, or thresholds&lt;/td&gt;
              &lt;td&gt;Use KQL to aggregate data into numeric values&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Azure Resource Graph&lt;/td&gt;
              &lt;td&gt;Alert on resource state or configuration changes&lt;/td&gt;
              &lt;td&gt;Use count aggregations to return numeric data&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Traces&lt;/td&gt;
              &lt;td&gt;Alert on trace data and application performance&lt;/td&gt;
              &lt;td&gt;Use aggregations to return numeric values for evaluation&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Alert queries must return numeric data that Grafana can evaluate against a threshold. Queries that return only text or non-numeric data cannot be used directly for alerting.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;authentication-requirements&#34;&gt;Authentication requirements&lt;/h2&gt;
&lt;p&gt;Alerting and recording rules run as background processes without a user context. This means they require service-level authentication and don&amp;rsquo;t work with all authentication methods.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Authentication method&lt;/th&gt;
              &lt;th&gt;Supported&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;App Registration (client secret)&lt;/td&gt;
              &lt;td&gt;✓&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Managed Identity&lt;/td&gt;
              &lt;td&gt;✓&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Workload Identity&lt;/td&gt;
              &lt;td&gt;✓&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Current User&lt;/td&gt;
              &lt;td&gt;✓ (with fallback service credentials)&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;If you use &lt;strong&gt;Current User&lt;/strong&gt; authentication, you must configure &lt;strong&gt;fallback service credentials&lt;/strong&gt; for alerting and recording rules to function. User credentials aren&amp;rsquo;t available for background operations, so Grafana uses the fallback credentials instead. Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/configure/&#34;&gt;configure the data source&lt;/a&gt; for details on setting up fallback credentials.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;create-an-alert-rule&#34;&gt;Create an alert rule&lt;/h2&gt;
&lt;p&gt;To create an alert rule using Azure Monitor data:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Alerting&lt;/strong&gt; &amp;gt; &lt;strong&gt;Alert rules&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;New alert rule&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter a name for your alert rule.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Define query and alert condition&lt;/strong&gt; section:
&lt;ul&gt;
&lt;li&gt;Select your Azure Monitor data source.&lt;/li&gt;
&lt;li&gt;Configure your query (for example, a Metrics query for CPU usage or a Logs query using KQL).&lt;/li&gt;
&lt;li&gt;Add a &lt;strong&gt;Reduce&lt;/strong&gt; expression if your query returns multiple series.&lt;/li&gt;
&lt;li&gt;Add a &lt;strong&gt;Threshold&lt;/strong&gt; expression to define the alert condition.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configure the &lt;strong&gt;Set evaluation behavior&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Select or create a folder and evaluation group.&lt;/li&gt;
&lt;li&gt;Set the evaluation interval (how often the alert is checked).&lt;/li&gt;
&lt;li&gt;Set the pending period (how long the condition must be true before firing).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add labels and annotations to provide context for notifications.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Save rule&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For detailed instructions, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-grafana-managed-rule/&#34;&gt;Create a Grafana-managed alert rule&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;example-vm-cpu-usage-alert&#34;&gt;Example: VM CPU usage alert&lt;/h2&gt;
&lt;p&gt;This example creates an alert that fires when virtual machine CPU usage exceeds 80%:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new alert rule.&lt;/li&gt;
&lt;li&gt;Configure the query:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Service&lt;/strong&gt;: Metrics&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource&lt;/strong&gt;: Select your virtual machine&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Metric namespace&lt;/strong&gt;: &lt;code&gt;Microsoft.Compute/virtualMachines&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Metric&lt;/strong&gt;: &lt;code&gt;Percentage CPU&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Aggregation&lt;/strong&gt;: &lt;code&gt;Average&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add expressions:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reduce&lt;/strong&gt;: Last (to get the most recent data point)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Threshold&lt;/strong&gt;: Is above 80&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Set evaluation to run every 1 minute with a 5-minute pending period.&lt;/li&gt;
&lt;li&gt;Save the rule.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;example-error-log-count-alert&#34;&gt;Example: Error log count alert&lt;/h2&gt;
&lt;p&gt;This example alerts when error logs exceed a threshold using a KQL query:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new alert rule.&lt;/li&gt;
&lt;li&gt;Configure the query:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Service&lt;/strong&gt;: Logs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource&lt;/strong&gt;: Select your Log Analytics workspace&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Query&lt;/strong&gt;:

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;AppExceptions
| where TimeGenerated &amp;gt; ago(5m)
| summarize ErrorCount = count() by bin(TimeGenerated, 1m)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add expressions:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reduce&lt;/strong&gt;: Max (to get the highest count in the period)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Threshold&lt;/strong&gt;: Is above 10&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Set evaluation to run every 5 minutes.&lt;/li&gt;
&lt;li&gt;Save the rule.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;example-resource-count-alert&#34;&gt;Example: Resource count alert&lt;/h2&gt;
&lt;p&gt;This example alerts when the number of running virtual machines drops below a threshold using Azure Resource Graph:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new alert rule.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the query:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Service&lt;/strong&gt;: Azure Resource Graph&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscriptions&lt;/strong&gt;: Select your subscriptions&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Query&lt;/strong&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;kusto&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-kusto&#34;&gt;resources
| where type == &amp;#34;microsoft.compute/virtualmachines&amp;#34;
| where properties.extended.instanceView.powerState.displayStatus == &amp;#34;VM running&amp;#34;
| summarize RunningVMs = count()&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add expressions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reduce&lt;/strong&gt;: Last&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Threshold&lt;/strong&gt;: Is below 3&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set evaluation to run every 5 minutes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save the rule.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;p&gt;Follow these recommendations to create reliable and efficient alerts with Azure Monitor data.&lt;/p&gt;
&lt;h3 id=&#34;use-appropriate-query-intervals&#34;&gt;Use appropriate query intervals&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Set the alert evaluation interval to be greater than or equal to the minimum data resolution from Azure Monitor.&lt;/li&gt;
&lt;li&gt;Azure Monitor Metrics typically have 1-minute granularity at minimum.&lt;/li&gt;
&lt;li&gt;Avoid very short intervals (less than 1 minute) as they may cause evaluation timeouts or miss data points.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;reduce-multiple-series&#34;&gt;Reduce multiple series&lt;/h3&gt;
&lt;p&gt;When your Azure Monitor query returns multiple time series (for example, CPU usage across multiple VMs), use the &lt;strong&gt;Reduce&lt;/strong&gt; expression to aggregate them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Last&lt;/strong&gt;: Use the most recent value&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mean&lt;/strong&gt;: Average across all series&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Max/Min&lt;/strong&gt;: Use the highest or lowest value&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sum&lt;/strong&gt;: Total across all series&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;optimize-log-analytics-queries&#34;&gt;Optimize Log Analytics queries&lt;/h3&gt;
&lt;p&gt;For Logs queries used in alerting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;summarize&lt;/code&gt; to aggregate data into numeric values.&lt;/li&gt;
&lt;li&gt;Include appropriate time filters using &lt;code&gt;ago()&lt;/code&gt; or &lt;code&gt;TimeGenerated&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Avoid returning large result sets; aggregate data in the query.&lt;/li&gt;
&lt;li&gt;Test queries in Explore before using them in alert rules.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;handle-no-data-conditions&#34;&gt;Handle no data conditions&lt;/h3&gt;
&lt;p&gt;Configure what happens when no data is returned:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the alert rule, find &lt;strong&gt;Configure no data and error handling&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose an appropriate action:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No Data&lt;/strong&gt;: Keep the alert in its current state&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alerting&lt;/strong&gt;: Treat no data as an alert condition&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OK&lt;/strong&gt;: Treat no data as a healthy state&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;test-queries-before-alerting&#34;&gt;Test queries before alerting&lt;/h3&gt;
&lt;p&gt;Always verify your query returns expected data before creating an alert:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Explore&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select your Azure Monitor data source.&lt;/li&gt;
&lt;li&gt;Run the query you plan to use for alerting.&lt;/li&gt;
&lt;li&gt;Confirm the data format and values are correct.&lt;/li&gt;
&lt;li&gt;Verify the query returns numeric data suitable for threshold evaluation.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If your Azure Monitor alerts aren&amp;rsquo;t working as expected, use the following sections to diagnose and resolve common issues.&lt;/p&gt;
&lt;h3 id=&#34;alerts-not-firing&#34;&gt;Alerts not firing&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Verify the data source uses a supported authentication method. If using Current User authentication, ensure fallback service credentials are configured.&lt;/li&gt;
&lt;li&gt;Check that the query returns numeric data in Explore.&lt;/li&gt;
&lt;li&gt;Ensure the evaluation interval allows enough time for data to be available.&lt;/li&gt;
&lt;li&gt;Review the alert rule&amp;rsquo;s health and any error messages in the Alerting UI.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;authentication-errors-in-alert-evaluation&#34;&gt;Authentication errors in alert evaluation&lt;/h3&gt;
&lt;p&gt;If you see authentication errors when alerts evaluate:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Confirm the data source is configured with App Registration, Managed Identity, Workload Identity, or Current User with fallback service credentials.&lt;/li&gt;
&lt;li&gt;If using App Registration, verify the client secret hasn&amp;rsquo;t expired.&lt;/li&gt;
&lt;li&gt;If using Current User, verify that fallback service credentials are configured and valid.&lt;/li&gt;
&lt;li&gt;Check that the service principal has appropriate permissions on Azure resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;query-timeout-errors&#34;&gt;Query timeout errors&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Simplify complex KQL queries.&lt;/li&gt;
&lt;li&gt;Reduce the time range in Log Analytics queries.&lt;/li&gt;
&lt;li&gt;Add more specific filters to narrow result sets.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For additional troubleshooting help, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/troubleshooting/&#34;&gt;Troubleshoot Azure Monitor&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;additional-resources&#34;&gt;Additional resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/&#34;&gt;Grafana Alerting documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-grafana-managed-rule/&#34;&gt;Create alert rules&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/query-editor/&#34;&gt;Azure Monitor query editor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-recording-rules/create-grafana-managed-recording-rules/&#34;&gt;Grafana-managed recording rules&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="azure-monitor-alerting">Azure Monitor alerting&lt;/h1>
&lt;p>The Azure Monitor data source supports
&lt;a href="/docs/grafana/v12.4/alerting/">Grafana Alerting&lt;/a> and
&lt;a href="/docs/grafana/v12.4/alerting/alerting-rules/create-recording-rules/create-grafana-managed-recording-rules/">Grafana-managed recording rules&lt;/a>, allowing you to create alert rules based on Azure metrics, logs, traces, and resource data. You can monitor your Azure environment and receive notifications when specific conditions are met.&lt;/p></description></item><item><title>Troubleshoot Azure Monitor data source issues</title><link>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/troubleshooting/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/azure-monitor/troubleshooting/</guid><content><![CDATA[&lt;h1 id=&#34;troubleshoot-azure-monitor-data-source-issues&#34;&gt;Troubleshoot Azure Monitor data source issues&lt;/h1&gt;
&lt;p&gt;This document provides solutions to common issues you may encounter when configuring or using the Azure Monitor data source.&lt;/p&gt;
&lt;h2 id=&#34;configuration-and-authentication-errors&#34;&gt;Configuration and authentication errors&lt;/h2&gt;
&lt;p&gt;These errors typically occur when setting up the data source or when authentication credentials are invalid.&lt;/p&gt;
&lt;h3 id=&#34;authorization-failed-or-access-denied&#34;&gt;&amp;ldquo;Authorization failed&amp;rdquo; or &amp;ldquo;Access denied&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Save &amp;amp; test fails with &amp;ldquo;Authorization failed&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Queries return &amp;ldquo;Access denied&amp;rdquo; errors&lt;/li&gt;
&lt;li&gt;Subscriptions don&amp;rsquo;t load when clicking &lt;strong&gt;Load Subscriptions&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Possible causes and solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Cause&lt;/th&gt;
              &lt;th&gt;Solution&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;App registration doesn&amp;rsquo;t have required permissions&lt;/td&gt;
              &lt;td&gt;Assign the &lt;code&gt;Reader&lt;/code&gt; role to the app registration on the subscription or resource group you want to monitor. Refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal?tabs=current&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation for role assignments&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Incorrect tenant ID, client ID, or client secret&lt;/td&gt;
              &lt;td&gt;Verify the credentials in the Azure Portal under &lt;strong&gt;App registrations&lt;/strong&gt; &amp;gt; your app &amp;gt; &lt;strong&gt;Overview&lt;/strong&gt; (for IDs) and &lt;strong&gt;Certificates &amp;amp; secrets&lt;/strong&gt; (for secret).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Client secret has expired&lt;/td&gt;
              &lt;td&gt;Create a new client secret in Azure and update the data source configuration.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Managed Identity not enabled on the Azure resource&lt;/td&gt;
              &lt;td&gt;For VMs, enable managed identity in the Azure Portal under &lt;strong&gt;Identity&lt;/strong&gt;. For App Service, enable it under &lt;strong&gt;Identity&lt;/strong&gt; in the app settings.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Managed Identity not assigned the Reader role&lt;/td&gt;
              &lt;td&gt;Assign the &lt;code&gt;Reader&lt;/code&gt; role to the managed identity on the target subscription or resources.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;invalid-client-secret-or-client-secret-not-found&#34;&gt;&amp;ldquo;Invalid client secret&amp;rdquo; or &amp;ldquo;Client secret not found&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Authentication fails immediately after configuration&lt;/li&gt;
&lt;li&gt;Error message references invalid credentials&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Ensure you copied the client secret &lt;strong&gt;value&lt;/strong&gt;, not the secret ID. In Azure Portal under &lt;strong&gt;Certificates &amp;amp; secrets&lt;/strong&gt;, the secret value is only shown once when created. The secret ID is a different identifier and won&amp;rsquo;t work for authentication.&lt;/li&gt;
&lt;li&gt;Verify the client secret was copied correctly (no extra spaces or truncation).&lt;/li&gt;
&lt;li&gt;Check if the secret has expired in Azure Portal under &lt;strong&gt;App registrations&lt;/strong&gt; &amp;gt; your app &amp;gt; &lt;strong&gt;Certificates &amp;amp; secrets&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Create a new secret and update the data source configuration.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;tenant-not-found-or-invalid-tenant-id&#34;&gt;&amp;ldquo;Tenant not found&amp;rdquo; or &amp;ldquo;Invalid tenant ID&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Data source test fails with tenant-related errors&lt;/li&gt;
&lt;li&gt;Unable to authenticate&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the Directory (tenant) ID in Azure Portal under &lt;strong&gt;Microsoft Entra ID&lt;/strong&gt; &amp;gt; &lt;strong&gt;Overview&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Ensure you&amp;rsquo;re using the correct Azure cloud setting (Azure, Azure Government, or Azure China).&lt;/li&gt;
&lt;li&gt;Check that the tenant ID is a valid GUID format.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;managed-identity-not-working&#34;&gt;Managed Identity not working&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Managed Identity option is available but authentication fails&lt;/li&gt;
&lt;li&gt;Error: &amp;ldquo;Managed identity authentication is not available&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify &lt;code&gt;managed_identity_enabled = true&lt;/code&gt; is set in the Grafana server configuration under &lt;code&gt;[azure]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Confirm the Azure resource hosting Grafana has managed identity enabled.&lt;/li&gt;
&lt;li&gt;For user-assigned managed identity, ensure &lt;code&gt;managed_identity_client_id&lt;/code&gt; is set correctly.&lt;/li&gt;
&lt;li&gt;Verify the managed identity has the &lt;code&gt;Reader&lt;/code&gt; role on the target resources.&lt;/li&gt;
&lt;li&gt;Restart Grafana after changing server configuration.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;workload-identity-not-working&#34;&gt;Workload Identity not working&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Workload Identity authentication fails in Kubernetes/AKS environment&lt;/li&gt;
&lt;li&gt;Token file errors&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify &lt;code&gt;workload_identity_enabled = true&lt;/code&gt; is set in the Grafana server configuration.&lt;/li&gt;
&lt;li&gt;Check that the service account is correctly annotated for workload identity.&lt;/li&gt;
&lt;li&gt;Verify the federated credential is configured in Azure.&lt;/li&gt;
&lt;li&gt;Ensure the token path is accessible to the Grafana pod.&lt;/li&gt;
&lt;li&gt;Check the workload identity webhook is running in the cluster.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;query-errors&#34;&gt;Query errors&lt;/h2&gt;
&lt;p&gt;These errors occur when executing queries against Azure Monitor services.&lt;/p&gt;
&lt;h3 id=&#34;no-data-or-empty-results&#34;&gt;&amp;ldquo;No data&amp;rdquo; or empty results&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query executes without error but returns no data&lt;/li&gt;
&lt;li&gt;Charts show &amp;ldquo;No data&amp;rdquo; message&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Possible causes and solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Cause&lt;/th&gt;
              &lt;th&gt;Solution&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Time range doesn&amp;rsquo;t contain data&lt;/td&gt;
              &lt;td&gt;Expand the dashboard time range or verify data exists in Azure Portal.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Wrong resource selected&lt;/td&gt;
              &lt;td&gt;Verify you&amp;rsquo;ve selected the correct subscription, resource group, and resource.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric not available for resource&lt;/td&gt;
              &lt;td&gt;Not all metrics are available for all resources. Check available metrics in Azure Portal under the resource&amp;rsquo;s &lt;strong&gt;Metrics&lt;/strong&gt; blade.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric has no values&lt;/td&gt;
              &lt;td&gt;Some metrics only populate under certain conditions (e.g., error counts when errors occur).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Permissions issue&lt;/td&gt;
              &lt;td&gt;Verify the identity has read access to the specific resource.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;bad-request-or-invalid-query&#34;&gt;&amp;ldquo;Bad request&amp;rdquo; or &amp;ldquo;Invalid query&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query fails with 400 error&lt;/li&gt;
&lt;li&gt;Error message indicates query syntax issues&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions for Logs queries:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Validate your KQL syntax in the Azure Portal Log Analytics query editor.&lt;/li&gt;
&lt;li&gt;Check for typos in table names or column names.&lt;/li&gt;
&lt;li&gt;Ensure referenced tables exist in the selected workspace.&lt;/li&gt;
&lt;li&gt;Verify the time range is valid (not in the future, not too far in the past for data retention).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Solutions for Metrics queries:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the metric name is valid for the selected resource type.&lt;/li&gt;
&lt;li&gt;Check that dimension filters use valid dimension names and values.&lt;/li&gt;
&lt;li&gt;Ensure the aggregation type is supported for the selected metric.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;resource-not-found&#34;&gt;&amp;ldquo;Resource not found&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query fails with 404 error&lt;/li&gt;
&lt;li&gt;Resource picker shows resources that can&amp;rsquo;t be queried&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the resource still exists in Azure (it may have been deleted or moved).&lt;/li&gt;
&lt;li&gt;Check that the subscription is correct.&lt;/li&gt;
&lt;li&gt;Refresh the resource picker by re-selecting the subscription.&lt;/li&gt;
&lt;li&gt;Verify the identity has access to the resource&amp;rsquo;s resource group.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;logs-query-timeout&#34;&gt;Logs query timeout&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query runs for a long time then fails&lt;/li&gt;
&lt;li&gt;Error mentions timeout or query limits&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Narrow the time range to reduce data volume.&lt;/li&gt;
&lt;li&gt;Add filters to reduce the result set.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;summarize&lt;/code&gt; to aggregate data instead of returning raw rows.&lt;/li&gt;
&lt;li&gt;Consider using Basic Logs for large datasets (if enabled).&lt;/li&gt;
&lt;li&gt;Break complex queries into smaller parts.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;metrics-not-available-for-a-resource&#34;&gt;&amp;ldquo;Metrics not available&amp;rdquo; for a resource&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Resource appears in picker but no metrics are listed&lt;/li&gt;
&lt;li&gt;Metric dropdown is empty&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the resource type supports Azure Monitor metrics.&lt;/li&gt;
&lt;li&gt;Check if the resource is in a region that supports metrics.&lt;/li&gt;
&lt;li&gt;Some resources require diagnostic settings to emit metrics—configure these in Azure Portal.&lt;/li&gt;
&lt;li&gt;Try selecting a different namespace for the resource.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;azure-resource-graph-errors&#34;&gt;Azure Resource Graph errors&lt;/h2&gt;
&lt;p&gt;These errors are specific to Azure Resource Graph (ARG) queries.&lt;/p&gt;
&lt;h3 id=&#34;query-execution-failed&#34;&gt;&amp;ldquo;Query execution failed&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ARG query fails with execution errors&lt;/li&gt;
&lt;li&gt;Results don&amp;rsquo;t match expected resources&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Validate query syntax in Azure Portal Resource Graph Explorer.&lt;/li&gt;
&lt;li&gt;Check that you have access to the subscriptions being queried.&lt;/li&gt;
&lt;li&gt;Verify table names are correct (e.g., &lt;code&gt;Resources&lt;/code&gt;, &lt;code&gt;ResourceContainers&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Some ARG features require specific permissions, check &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/governance/resource-graph/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ARG documentation&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;query-returns-incomplete-results&#34;&gt;Query returns incomplete results&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Not all expected resources appear in results&lt;/li&gt;
&lt;li&gt;Results seem truncated&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;ARG queries are paginated. The data source handles pagination automatically, but very large result sets may be limited.&lt;/li&gt;
&lt;li&gt;Add filters to reduce result set size.&lt;/li&gt;
&lt;li&gt;Verify you have access to all subscriptions containing the resources.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;application-insights-traces-errors&#34;&gt;Application Insights Traces errors&lt;/h2&gt;
&lt;p&gt;These errors are specific to the Traces query type.&lt;/p&gt;
&lt;h3 id=&#34;no-traces-found&#34;&gt;&amp;ldquo;No traces found&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Trace query returns empty results&lt;/li&gt;
&lt;li&gt;Operation ID search finds nothing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the Application Insights resource is collecting trace data.&lt;/li&gt;
&lt;li&gt;Check that the time range includes when the traces were generated.&lt;/li&gt;
&lt;li&gt;Ensure the Operation ID is correct (copy directly from another trace or log).&lt;/li&gt;
&lt;li&gt;Verify the identity has access to the Application Insights resource.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;template-variable-errors&#34;&gt;Template variable errors&lt;/h2&gt;
&lt;p&gt;For detailed troubleshooting of template variables, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/template-variables/&#34;&gt;template variables troubleshooting section&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;variables-return-no-values&#34;&gt;Variables return no values&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the data source connection is working (test it in the data source settings).&lt;/li&gt;
&lt;li&gt;Check that parent variables (for cascading variables) have valid selections.&lt;/li&gt;
&lt;li&gt;Verify the identity has permissions to list the requested resources.&lt;/li&gt;
&lt;li&gt;For Logs variables, ensure the KQL query returns a single column.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;variables-are-slow-to-load&#34;&gt;Variables are slow to load&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set variable refresh to &lt;strong&gt;On dashboard load&lt;/strong&gt; instead of &lt;strong&gt;On time range change&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Reduce the scope of variable queries (e.g., filter by resource group instead of entire subscription).&lt;/li&gt;
&lt;li&gt;For Logs variables, optimize the KQL query to return results faster.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;connection-and-network-errors&#34;&gt;Connection and network errors&lt;/h2&gt;
&lt;p&gt;These errors indicate problems with network connectivity between Grafana and Azure services.&lt;/p&gt;
&lt;h3 id=&#34;connection-refused-or-timeout-errors&#34;&gt;&amp;ldquo;Connection refused&amp;rdquo; or timeout errors&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Data source test fails with network errors&lt;/li&gt;
&lt;li&gt;Queries timeout without returning results&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify network connectivity from Grafana to Azure endpoints.&lt;/li&gt;
&lt;li&gt;Check firewall rules allow outbound HTTPS (port 443) to Azure services.&lt;/li&gt;
&lt;li&gt;For private networks, ensure Private Link or VPN is configured correctly.&lt;/li&gt;
&lt;li&gt;For Grafana Cloud, configure 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/configure/&#34;&gt;Private Data Source Connect&lt;/a&gt; if accessing private resources.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;ssltls-certificate-errors&#34;&gt;SSL/TLS certificate errors&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Certificate validation failures&lt;/li&gt;
&lt;li&gt;SSL handshake errors&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Ensure the system time is correct (certificate validation fails with incorrect time).&lt;/li&gt;
&lt;li&gt;Verify corporate proxy isn&amp;rsquo;t intercepting HTTPS traffic.&lt;/li&gt;
&lt;li&gt;Check that required CA certificates are installed on the Grafana server.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;get-additional-help&#34;&gt;Get additional help&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;ve tried the solutions above and still encounter issues:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check the &lt;a href=&#34;https://community.grafana.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana community forums&lt;/a&gt; for similar issues.&lt;/li&gt;
&lt;li&gt;Review the &lt;a href=&#34;https://github.com/grafana/grafana/issues&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure Monitor data source GitHub issues&lt;/a&gt; for known bugs.&lt;/li&gt;
&lt;li&gt;Enable debug logging in Grafana to capture detailed error information.&lt;/li&gt;
&lt;li&gt;Contact Grafana Support if you&amp;rsquo;re an Enterprise, Cloud Pro or Cloud Contracted user.&lt;/li&gt;
&lt;li&gt;When reporting issues, include:
&lt;ul&gt;
&lt;li&gt;Grafana version&lt;/li&gt;
&lt;li&gt;Error messages (redact sensitive information)&lt;/li&gt;
&lt;li&gt;Steps to reproduce&lt;/li&gt;
&lt;li&gt;Relevant configuration (redact credentials)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="troubleshoot-azure-monitor-data-source-issues">Troubleshoot Azure Monitor data source issues&lt;/h1>
&lt;p>This document provides solutions to common issues you may encounter when configuring or using the Azure Monitor data source.&lt;/p></description></item></channel></rss>