<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configure the Prometheus data source on Grafana Labs</title><link>https://grafana.com/docs/grafana/v13.1/datasources/prometheus/configure/</link><description>Recent content in Configure the Prometheus data source on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v13.1/datasources/prometheus/configure/index.xml" rel="self" type="application/rss+xml"/><item><title>Migrate from Prometheus Azure AD to Azure Monitor Managed Service for Prometheus</title><link>https://grafana.com/docs/grafana/v13.1/datasources/prometheus/configure/azure-authentication/</link><pubDate>Tue, 23 Jun 2026 13:06:40 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.1/datasources/prometheus/configure/azure-authentication/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-from-prometheus-azure-ad-to-azure-monitor-managed-service-for-prometheus&#34;&gt;Migrate from Prometheus Azure AD to Azure Monitor Managed Service for Prometheus&lt;/h1&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;Using Azure AD authentication with the core Prometheus data source for Azure Monitor Managed Service for Prometheus is &lt;strong&gt;deprecated&lt;/strong&gt;. In Grafana 13, the migration to the dedicated &lt;a href=&#34;/grafana/plugins/grafana-azureprometheus-datasource/&#34;&gt;Azure Monitor Managed Service for Prometheus data source&lt;/a&gt; is automatic. Existing data sources using Azure AD authentication are migrated on startup.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;For background on this change, refer to &lt;a href=&#34;/blog/2025/06/16/prometheus-data-source-update-redefining-our-big-tent-philosophy/&#34;&gt;Prometheus data source update: Redefining our big tent philosophy&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;what-changed-in-grafana-13&#34;&gt;What changed in Grafana 13&lt;/h2&gt;
&lt;p&gt;In Grafana 13, the &lt;code&gt;prometheusTypeMigration&lt;/code&gt; feature toggle is enabled by default and deprecated. This means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prometheus data sources configured with Azure AD authentication are &lt;strong&gt;automatically migrated&lt;/strong&gt; to the dedicated Azure Monitor Managed Service for Prometheus plugin on Grafana startup.&lt;/li&gt;
&lt;li&gt;You no longer need to manually enable the feature toggle.&lt;/li&gt;
&lt;li&gt;Grafana Cloud users are migrated automatically with no action required.&lt;/li&gt;
&lt;li&gt;Dashboards, alerts, and queries continue to work after migration without changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;check-migration-status&#34;&gt;Check migration status&lt;/h2&gt;
&lt;p&gt;To determine if your Prometheus data sources have been migrated:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select your Prometheus data source.&lt;/li&gt;
&lt;li&gt;Look for a migration banner at the top of the configuration page.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The banner displays one of the following messages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;ldquo;Migration Notice&amp;rdquo;&lt;/strong&gt; — The data source has been migrated to the Azure Monitor Managed Service for Prometheus plugin.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;ldquo;Deprecation Notice&amp;rdquo;&lt;/strong&gt; — The data source hasn&amp;rsquo;t been migrated yet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No banner&lt;/strong&gt; — No migration is needed (the data source doesn&amp;rsquo;t use Azure AD authentication).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-the-azure-monitor-managed-service-for-prometheus-data-source&#34;&gt;Configure the Azure Monitor Managed Service for Prometheus data source&lt;/h2&gt;
&lt;p&gt;After migration (or for new setups), configure the dedicated plugin:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select your Azure Monitor Managed Service for Prometheus data source.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Authentication&lt;/strong&gt; section, select your authentication method:&lt;/li&gt;
&lt;/ol&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;Method&lt;/th&gt;
              &lt;th&gt;Use case&lt;/th&gt;
              &lt;th&gt;Additional configuration required&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Managed Identity&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Azure-hosted Grafana instances&lt;/td&gt;
              &lt;td&gt;None (system-assigned) or Client ID (user-assigned)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;App Registration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Service principal authentication&lt;/td&gt;
              &lt;td&gt;Directory ID, Application ID, Client secret&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;Current user&amp;rsquo;s Entra ID credentials&lt;/td&gt;
              &lt;td&gt;None&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;For Managed Identity authentication:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No additional configuration is required if using a system-assigned identity.&lt;/li&gt;
&lt;li&gt;For a user-assigned identity, provide the &lt;strong&gt;Client ID&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For App Registration authentication:&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;th&gt;Example&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Directory (tenant) ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Your Entra ID tenant ID&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;12345678-1234-1234-1234-123456789012&lt;/code&gt;&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;Your app registration client ID&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;87654321-4321-4321-4321-210987654321&lt;/code&gt;&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;Your app registration secret&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;your-client-secret&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;To learn more about Entra ID authentication for Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v13.1/setup-grafana/configure-access/configure-authentication/azuread/#configure-azure-adentra-id-oauth-authentication&#34;&gt;Configure Entra ID OAuth authentication&lt;/a&gt;.&lt;/p&gt;
&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;
&lt;p&gt;Set the &lt;strong&gt;Prometheus server URL&lt;/strong&gt; to your Azure Monitor workspace endpoint:&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;https://your-workspace.eastus2.prometheus.monitor.azure.com&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt; to verify the connection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h2&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 Prometheus
    type: grafana-azureprometheus-datasource
    url: https://your-workspace.eastus2.prometheus.monitor.azure.com
    jsonData:
      azureCredentials:
        authType: clientsecret
        azureCloud: AzureCloud
        clientId: &amp;lt;CLIENT_ID&amp;gt;
        tenantId: &amp;lt;TENANT_ID&amp;gt;
      httpMethod: POST
    secureJsonData:
      azureClientSecret: &amp;lt;CLIENT_SECRET&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;lt;CLIENT_ID&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;TENANT_ID&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;CLIENT_SECRET&amp;gt;&lt;/code&gt; with your Azure credentials.&lt;/p&gt;
&lt;h2 id=&#34;troubleshoot-migration-issues&#34;&gt;Troubleshoot migration issues&lt;/h2&gt;
&lt;h3 id=&#34;azure-monitor-managed-service-for-prometheus-plugin-not-installed&#34;&gt;Azure Monitor Managed Service for Prometheus plugin not installed&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; Migration doesn&amp;rsquo;t occur or the data source type is missing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Add new connection&lt;/strong&gt; and search for &amp;ldquo;Azure Monitor Managed Service for Prometheus&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;Install the plugin if it isn&amp;rsquo;t already installed.&lt;/li&gt;
&lt;li&gt;For air-gapped environments, download the plugin from &lt;a href=&#34;/grafana/plugins/grafana-azureprometheus-datasource/&#34;&gt;the Grafana plugin catalog&lt;/a&gt; and install it manually.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;401-unauthorized-after-migration&#34;&gt;&amp;ldquo;401 Unauthorized&amp;rdquo; after migration&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; The migrated data source returns authentication errors.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Self-hosted Grafana:&lt;/strong&gt; Verify that &lt;code&gt;grafana-azureprometheus-datasource&lt;/code&gt; is included in &lt;code&gt;forward_settings_to_plugins&lt;/code&gt; under the &lt;code&gt;[azure]&lt;/code&gt; heading in your &lt;code&gt;.ini&lt;/code&gt; configuration file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grafana Cloud:&lt;/strong&gt; Contact &lt;a href=&#34;/profile/org#support&#34;&gt;Grafana Support&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;rollback-the-migration&#34;&gt;Rollback the migration&lt;/h3&gt;
&lt;p&gt;If you need to revert migrated data sources back to the core Prometheus type:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set &lt;code&gt;prometheusTypeMigration&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; in your Grafana configuration feature toggles. For more information, refer to 
    &lt;a href=&#34;/docs/grafana/v13.1/setup-grafana/configure-grafana/feature-toggles/#manage-feature-toggles&#34;&gt;Manage feature toggles&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Restart Grafana.&lt;/li&gt;
&lt;li&gt;Obtain a bearer token with &lt;code&gt;read&lt;/code&gt; and &lt;code&gt;write&lt;/code&gt; permissions for the data source API. For more information, refer to 
    &lt;a href=&#34;/docs/grafana/v13.1/developers/http_api/data_source/&#34;&gt;Data source API&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Run the following rollback script, providing your Grafana URL and bearer token:&lt;/li&gt;
&lt;/ol&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;sh&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-sh&#34;&gt;#!/bin/bash

GRAFANA_URL=&amp;#34;&amp;#34;
BEARER_TOKEN=&amp;#34;&amp;#34;
LOG_FILE=&amp;#34;grafana_azure_migration_rollback_$(date &amp;#43;%Y%m%d_%H%M%S).log&amp;#34;

log_message() {
    local message=&amp;#34;$1&amp;#34;
    local timestamp=$(date &amp;#39;&amp;#43;%Y-%m-%d %H:%M:%S&amp;#39;)
    echo &amp;#34;[$timestamp] $message&amp;#34; | tee -a &amp;#34;$LOG_FILE&amp;#34;
}

update_data_source() {
    local uid=&amp;#34;$1&amp;#34;
    local data=&amp;#34;$2&amp;#34;

    response=$(curl -s -w &amp;#34;\n%{http_code}&amp;#34; -X PUT \
        -H &amp;#34;Content-Type: application/json&amp;#34; \
        -H &amp;#34;Authorization: Bearer $BEARER_TOKEN&amp;#34; \
        -d &amp;#34;$data&amp;#34; \
        &amp;#34;$GRAFANA_URL/api/datasources/uid/$uid&amp;#34;)

    http_code=$(echo &amp;#34;$response&amp;#34; | tail -n1)
    response_body=$(echo &amp;#34;$response&amp;#34; | sed &amp;#39;$d&amp;#39;)

    if [[ &amp;#34;$http_code&amp;#34; -ge 200 &amp;amp;&amp;amp; &amp;#34;$http_code&amp;#34; -lt 300 ]]; then
        log_message &amp;#34;$uid reverted successfully&amp;#34;
    else
        log_message &amp;#34;$uid error: HTTP $http_code - $response_body&amp;#34;
    fi
}

if ! command -v jq &amp;amp;&amp;gt; /dev/null; then
    echo &amp;#34;Error: jq is required but not installed.&amp;#34;
    exit 1
fi

if [[ -z &amp;#34;$GRAFANA_URL&amp;#34; || -z &amp;#34;$BEARER_TOKEN&amp;#34; ]]; then
    echo &amp;#34;Error: Set GRAFANA_URL and BEARER_TOKEN variables at the top of the script.&amp;#34;
    exit 1
fi

log_message &amp;#34;Starting Azure Prometheus to core Prometheus rollback&amp;#34;

response=$(curl -s -w &amp;#34;\n%{http_code}&amp;#34; -X GET \
    -H &amp;#34;Content-Type: application/json&amp;#34; \
    -H &amp;#34;Authorization: Bearer $BEARER_TOKEN&amp;#34; \
    &amp;#34;$GRAFANA_URL/api/datasources/&amp;#34;)

http_code=$(echo &amp;#34;$response&amp;#34; | tail -n1)
response_body=$(echo &amp;#34;$response&amp;#34; | sed &amp;#39;$d&amp;#39;)

if [[ &amp;#34;$http_code&amp;#34; -lt 200 || &amp;#34;$http_code&amp;#34; -ge 300 ]]; then
    log_message &amp;#34;Error fetching data sources: HTTP $http_code&amp;#34;
    exit 1
fi

total=$(echo &amp;#34;$response_body&amp;#34; | jq &amp;#39;[.[] | select(.jsonData[&amp;#34;prometheus-type-migration&amp;#34;] == true and .type == &amp;#34;grafana-azureprometheus-datasource&amp;#34;)] | length&amp;#39;)
log_message &amp;#34;Found $total data sources to revert&amp;#34;

echo &amp;#34;$response_body&amp;#34; | jq -c &amp;#39;.[] | select(.jsonData[&amp;#34;prometheus-type-migration&amp;#34;] == true and .type == &amp;#34;grafana-azureprometheus-datasource&amp;#34;)&amp;#39; | while read -r data; do
    uid=$(echo &amp;#34;$data&amp;#34; | jq -r &amp;#39;.uid&amp;#39;)
    read_only=$(echo &amp;#34;$data&amp;#34; | jq -r &amp;#39;.readOnly // false&amp;#39;)

    if [[ &amp;#34;$read_only&amp;#34; == &amp;#34;true&amp;#34; ]]; then
        log_message &amp;#34;$uid is readOnly — edit the type to &amp;#39;prometheus&amp;#39; in the provisioning file instead.&amp;#34;
        continue
    fi

    updated_data=$(echo &amp;#34;$data&amp;#34; | jq &amp;#39;.type = &amp;#34;prometheus&amp;#34; | .jsonData[&amp;#34;prometheus-type-migration&amp;#34;] = false&amp;#39;)
    update_data_source &amp;#34;$uid&amp;#34; &amp;#34;$updated_data&amp;#34;
done

log_message &amp;#34;Rollback complete. Log: $LOG_FILE&amp;#34;&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;Provisioned data sources (&lt;code&gt;readOnly&lt;/code&gt;) can&amp;rsquo;t be reverted via the API. Update the &lt;code&gt;type&lt;/code&gt; field to &lt;code&gt;prometheus&lt;/code&gt; in your provisioning YAML file instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;If you continue to experience issues, check the Grafana server logs for detailed error messages and contact &lt;a href=&#34;/help/&#34;&gt;Grafana Support&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="migrate-from-prometheus-azure-ad-to-azure-monitor-managed-service-for-prometheus">Migrate from Prometheus Azure AD to Azure Monitor Managed Service for Prometheus&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Using Azure AD authentication with the core Prometheus data source for Azure Monitor Managed Service for Prometheus is &lt;strong>deprecated&lt;/strong>. In Grafana 13, the migration to the dedicated &lt;a href="/grafana/plugins/grafana-azureprometheus-datasource/">Azure Monitor Managed Service for Prometheus data source&lt;/a> is automatic. Existing data sources using Azure AD authentication are migrated on startup.&lt;/p></description></item><item><title>Migrate from Prometheus SigV4 to Amazon Managed Service for Prometheus</title><link>https://grafana.com/docs/grafana/v13.1/datasources/prometheus/configure/aws-authentication/</link><pubDate>Tue, 23 Jun 2026 13:06:40 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.1/datasources/prometheus/configure/aws-authentication/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-from-prometheus-sigv4-to-amazon-managed-service-for-prometheus&#34;&gt;Migrate from Prometheus SigV4 to Amazon Managed Service for Prometheus&lt;/h1&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;Using SigV4 authentication with the core Prometheus data source for Amazon Managed Service for Prometheus is &lt;strong&gt;deprecated&lt;/strong&gt;. In Grafana 13, the migration to the dedicated &lt;a href=&#34;/grafana/plugins/grafana-amazonprometheus-datasource/&#34;&gt;Amazon Managed Service for Prometheus data source&lt;/a&gt; is automatic. Existing data sources using SigV4 are migrated on startup.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;For background on this change, refer to &lt;a href=&#34;/blog/2025/06/16/prometheus-data-source-update-redefining-our-big-tent-philosophy/&#34;&gt;Prometheus data source update: Redefining our big tent philosophy&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;what-changed-in-grafana-13&#34;&gt;What changed in Grafana 13&lt;/h2&gt;
&lt;p&gt;In Grafana 13, the &lt;code&gt;prometheusTypeMigration&lt;/code&gt; feature toggle is enabled by default and deprecated. This means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prometheus data sources configured with SigV4 authentication are &lt;strong&gt;automatically migrated&lt;/strong&gt; to the dedicated Amazon Managed Service for Prometheus plugin on Grafana startup.&lt;/li&gt;
&lt;li&gt;You no longer need to manually enable the feature toggle.&lt;/li&gt;
&lt;li&gt;Grafana Cloud users are migrated automatically with no action required.&lt;/li&gt;
&lt;li&gt;Dashboards, alerts, and queries continue to work after migration without changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;check-migration-status&#34;&gt;Check migration status&lt;/h2&gt;
&lt;p&gt;To determine if your Prometheus data sources have been migrated:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select your Prometheus data source.&lt;/li&gt;
&lt;li&gt;Look for a migration banner at the top of the configuration page.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The banner displays one of the following messages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;ldquo;Migration Notice&amp;rdquo;&lt;/strong&gt; — The data source has been migrated to the Amazon Managed Service for Prometheus plugin.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;ldquo;Deprecation Notice&amp;rdquo;&lt;/strong&gt; — The data source hasn&amp;rsquo;t been migrated yet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No banner&lt;/strong&gt; — No migration is needed (the data source doesn&amp;rsquo;t use SigV4).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-the-amazon-managed-service-for-prometheus-data-source&#34;&gt;Configure the Amazon Managed Service for Prometheus data source&lt;/h2&gt;
&lt;p&gt;After migration (or for new setups), configure the dedicated plugin:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select your Amazon Managed Service for Prometheus data source.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Auth&lt;/strong&gt; section, configure SigV4 authentication:&lt;/li&gt;
&lt;/ol&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;th&gt;Example&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Authentication Provider&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Choose your auth method&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;AWS SDK Default&lt;/code&gt;, &lt;code&gt;Access &amp;amp; secret key&lt;/code&gt;, or &lt;code&gt;Credentials file&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default Region&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;AWS region for your workspace&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;us-west-2&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Access Key ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Your AWS access key (if using access key auth)&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;AKIA...&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Secret Access Key&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Your AWS secret key (if using access key auth)&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;wJalrXUtn...&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Assume Role ARN&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;IAM role ARN (optional)&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;arn:aws:iam::123456789:role/GrafanaRole&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;
&lt;p&gt;Set the &lt;strong&gt;HTTP URL&lt;/strong&gt; to your Amazon Managed Service for Prometheus workspace endpoint:
&lt;code&gt;https://aps-workspaces.us-west-2.amazonaws.com/workspaces/ws-12345678-1234-1234-1234-123456789012/&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt; to verify the connection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h2&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: Amazon Managed Prometheus
    type: grafana-amazonprometheus-datasource
    url: https://aps-workspaces.us-west-2.amazonaws.com/workspaces/ws-12345678-1234-1234-1234-123456789012/
    jsonData:
      httpMethod: POST
      sigV4Auth: true
      sigV4AuthType: keys
      sigV4Region: us-east-2
    secureJsonData:
      sigV4AccessKey: &amp;lt;ACCESS_KEY&amp;gt;
      sigV4SecretKey: &amp;lt;SECRET_KEY&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;lt;ACCESS_KEY&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;SECRET_KEY&amp;gt;&lt;/code&gt; with your AWS credentials.&lt;/p&gt;
&lt;h2 id=&#34;troubleshoot-migration-issues&#34;&gt;Troubleshoot migration issues&lt;/h2&gt;
&lt;h3 id=&#34;amazon-managed-service-for-prometheus-plugin-not-installed&#34;&gt;Amazon Managed Service for Prometheus plugin not installed&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; Migration doesn&amp;rsquo;t occur or the data source type is missing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Add new connection&lt;/strong&gt; and search for &amp;ldquo;Amazon Managed Service for Prometheus&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;Install the plugin if it isn&amp;rsquo;t already installed.&lt;/li&gt;
&lt;li&gt;For air-gapped environments, download the plugin from &lt;a href=&#34;/grafana/plugins/grafana-amazonprometheus-datasource/&#34;&gt;the Grafana plugin catalog&lt;/a&gt; and install it manually.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;401-unauthorized-after-migration&#34;&gt;&amp;ldquo;401 Unauthorized&amp;rdquo; after migration&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; The migrated data source returns authentication errors.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Self-hosted Grafana:&lt;/strong&gt; Verify that &lt;code&gt;grafana-amazonprometheus-datasource&lt;/code&gt; is included in &lt;code&gt;forward_settings_to_plugins&lt;/code&gt; under the &lt;code&gt;[aws]&lt;/code&gt; heading in your &lt;code&gt;.ini&lt;/code&gt; configuration file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grafana Cloud:&lt;/strong&gt; Contact &lt;a href=&#34;/profile/org#support&#34;&gt;Grafana Support&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;rollback-the-migration&#34;&gt;Rollback the migration&lt;/h3&gt;
&lt;p&gt;If you need to revert migrated data sources back to the core Prometheus type:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set &lt;code&gt;prometheusTypeMigration&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; in your Grafana configuration feature toggles. For more information, refer to 
    &lt;a href=&#34;/docs/grafana/v13.1/setup-grafana/configure-grafana/feature-toggles/#manage-feature-toggles&#34;&gt;Manage feature toggles&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Restart Grafana.&lt;/li&gt;
&lt;li&gt;Obtain a bearer token with &lt;code&gt;read&lt;/code&gt; and &lt;code&gt;write&lt;/code&gt; permissions for the data source API. For more information, refer to 
    &lt;a href=&#34;/docs/grafana/v13.1/developers/http_api/data_source/&#34;&gt;Data source API&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Run the following rollback script, providing your Grafana URL and bearer token:&lt;/li&gt;
&lt;/ol&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;sh&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-sh&#34;&gt;#!/bin/bash

GRAFANA_URL=&amp;#34;&amp;#34;
BEARER_TOKEN=&amp;#34;&amp;#34;
LOG_FILE=&amp;#34;grafana_migration_rollback_$(date &amp;#43;%Y%m%d_%H%M%S).log&amp;#34;

log_message() {
    local message=&amp;#34;$1&amp;#34;
    local timestamp=$(date &amp;#39;&amp;#43;%Y-%m-%d %H:%M:%S&amp;#39;)
    echo &amp;#34;[$timestamp] $message&amp;#34; | tee -a &amp;#34;$LOG_FILE&amp;#34;
}

update_data_source() {
    local uid=&amp;#34;$1&amp;#34;
    local data=&amp;#34;$2&amp;#34;

    response=$(curl -s -w &amp;#34;\n%{http_code}&amp;#34; -X PUT \
        -H &amp;#34;Content-Type: application/json&amp;#34; \
        -H &amp;#34;Authorization: Bearer $BEARER_TOKEN&amp;#34; \
        -d &amp;#34;$data&amp;#34; \
        &amp;#34;$GRAFANA_URL/api/datasources/uid/$uid&amp;#34;)

    http_code=$(echo &amp;#34;$response&amp;#34; | tail -n1)
    response_body=$(echo &amp;#34;$response&amp;#34; | sed &amp;#39;$d&amp;#39;)

    if [[ &amp;#34;$http_code&amp;#34; -ge 200 &amp;amp;&amp;amp; &amp;#34;$http_code&amp;#34; -lt 300 ]]; then
        log_message &amp;#34;$uid reverted successfully&amp;#34;
    else
        log_message &amp;#34;$uid error: HTTP $http_code - $response_body&amp;#34;
    fi
}

if ! command -v jq &amp;amp;&amp;gt; /dev/null; then
    echo &amp;#34;Error: jq is required but not installed.&amp;#34;
    exit 1
fi

if [[ -z &amp;#34;$GRAFANA_URL&amp;#34; || -z &amp;#34;$BEARER_TOKEN&amp;#34; ]]; then
    echo &amp;#34;Error: Set GRAFANA_URL and BEARER_TOKEN variables at the top of the script.&amp;#34;
    exit 1
fi

log_message &amp;#34;Starting AMP to Prometheus rollback&amp;#34;

response=$(curl -s -w &amp;#34;\n%{http_code}&amp;#34; -X GET \
    -H &amp;#34;Content-Type: application/json&amp;#34; \
    -H &amp;#34;Authorization: Bearer $BEARER_TOKEN&amp;#34; \
    &amp;#34;$GRAFANA_URL/api/datasources/&amp;#34;)

http_code=$(echo &amp;#34;$response&amp;#34; | tail -n1)
response_body=$(echo &amp;#34;$response&amp;#34; | sed &amp;#39;$d&amp;#39;)

if [[ &amp;#34;$http_code&amp;#34; -lt 200 || &amp;#34;$http_code&amp;#34; -ge 300 ]]; then
    log_message &amp;#34;Error fetching data sources: HTTP $http_code&amp;#34;
    exit 1
fi

total=$(echo &amp;#34;$response_body&amp;#34; | jq &amp;#39;[.[] | select(.jsonData[&amp;#34;prometheus-type-migration&amp;#34;] == true and .type == &amp;#34;grafana-amazonprometheus-datasource&amp;#34;)] | length&amp;#39;)
log_message &amp;#34;Found $total data sources to revert&amp;#34;

echo &amp;#34;$response_body&amp;#34; | jq -c &amp;#39;.[] | select(.jsonData[&amp;#34;prometheus-type-migration&amp;#34;] == true and .type == &amp;#34;grafana-amazonprometheus-datasource&amp;#34;)&amp;#39; | while read -r data; do
    uid=$(echo &amp;#34;$data&amp;#34; | jq -r &amp;#39;.uid&amp;#39;)
    read_only=$(echo &amp;#34;$data&amp;#34; | jq -r &amp;#39;.readOnly // false&amp;#39;)

    if [[ &amp;#34;$read_only&amp;#34; == &amp;#34;true&amp;#34; ]]; then
        log_message &amp;#34;$uid is readOnly — edit the type to &amp;#39;prometheus&amp;#39; in the provisioning file instead.&amp;#34;
        continue
    fi

    updated_data=$(echo &amp;#34;$data&amp;#34; | jq &amp;#39;.type = &amp;#34;prometheus&amp;#34; | .jsonData[&amp;#34;prometheus-type-migration&amp;#34;] = false&amp;#39;)
    update_data_source &amp;#34;$uid&amp;#34; &amp;#34;$updated_data&amp;#34;
done

log_message &amp;#34;Rollback complete. Log: $LOG_FILE&amp;#34;&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;Provisioned data sources (&lt;code&gt;readOnly&lt;/code&gt;) can&amp;rsquo;t be reverted via the API. Update the &lt;code&gt;type&lt;/code&gt; field to &lt;code&gt;prometheus&lt;/code&gt; in your provisioning YAML file instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;If you continue to experience issues, check the Grafana server logs for detailed error messages and contact &lt;a href=&#34;/help/&#34;&gt;Grafana Support&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="migrate-from-prometheus-sigv4-to-amazon-managed-service-for-prometheus">Migrate from Prometheus SigV4 to Amazon Managed Service for Prometheus&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Using SigV4 authentication with the core Prometheus data source for Amazon Managed Service for Prometheus is &lt;strong>deprecated&lt;/strong>. In Grafana 13, the migration to the dedicated &lt;a href="/grafana/plugins/grafana-amazonprometheus-datasource/">Amazon Managed Service for Prometheus data source&lt;/a> is automatic. Existing data sources using SigV4 are migrated on startup.&lt;/p></description></item></channel></rss>