Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article explains how to use Azure Monitor dashboards with Grafana.
Prerequisites
- Running Azure resources that have created data over at least a 15-minute period.
- Assigned Monitoring Reader for access to Azure Managed Prometheus (Azure Monitor Workspace).
For more information about RBAC and assigning roles, see Azure RBAC.
Use dashboard templates
Azure managed template dashboards help you get started quickly with pre-provisioned and automatically updated dashboards for frequently used Azure resources and Azure Kubernetes Services. They're identified with an Azure-managed tag.
Use the following steps to use the Grafana dashboards that are already available in the Azure portal.
- Navigate to Azure Monitor in the Azure portal.
- Select Dashboards with Grafana.
- Browse the list of available dashboards in the Azure Monitor or Azure Managed Prometheus listings.
- Select a dashboard, for example Azure | Insights | Storage Accounts or Azure | Insights | Key Vaults.
- Choose a subscription and resource group where the target resource exists. The dashboard loads based on the dashboard you chose and the selected resources.
Other Azure resources with built-in dashboard templates include the following. Access from the Monitoring > Dashboards with Grafana menu item for the following resources:
- Azure Kubernetes
- AKS Automatic
- AKS Arc
- App Insights
- Azure Container Apps
- Azure Monitor Workspace
Create a new Grafana dashboard
- Select New > New Dashboard from within the Grafana interface.
- Select Add visualization.
- Choose a supported data source (Azure Monitor, Azure Data Explorer or Prometheus) for the first panel.
- Add panels using built-in or code-based query editors.
Save a copy of a dashboard
You can choose Save As to save the dashboard to your subscription and make edits without affecting the original dashboard.
- Open the dashboard.
- Choose Save As.
- Enter a title in the Title field.
- Choose the subscription for the dashboard from the Subscription dropdown list.
- Choose the resource group from the Resource Group dropdown list.
- Choose the location (region) from the Location dropdown list.
- Select Save.
- Select Yes to open the dashboard copy and begin editing.
Edit a dashboard
Note
Editing tools and behavior follow standard Grafana open-source controls.
- Open an editable dashboard (created or imported).
- Select Edit to modify panels, queries, and visualizations.
For more details on editing a Grafana dashboard, see the Grafana documentation.
Import Grafana dashboards using JSON
The following instructions assume you signed in to your Azure account, are in the Azure Monitor area of the Azure portal, and selected Dashboards with Grafana.
Using the Grafana website window or tab, navigate to the dashboard you want to import.
- Download the JSON file for the dashboard.
- Using the Azure portal window or tab, on the Dashboards with Grafana screen, select New > Import.
- Select the JSON file.
- Select Load.
- Enter a name for the dashboard.
- Select the subscription, resource group, and region.
Import from Grafana public gallery
- Visit the Grafana dashboard gallery.
- Locate a dashboard using a JSON file or Dashboard ID.
- On the Azure Monitor page in the Azure portal, open Import in Azure Monitor dashboards.
- Enter the Dashboard ID or upload the corresponding JSON file.
- Follow the import steps listed above.
Note
Only Azure Monitor and Prometheus dashboards using supported data sources can be imported.
Use Explore to copy and edit a query and panel
You can copy and edit a query and panel without breaking or changing the original query with the Explore feature.
- Select the resource you want to monitor, for example an AKS cluster.
- Select Dashboards with Grafana. A list of available dashboards appears.
- Select a dashboard, for example the Kubernetes | Compute Resources | Cluster dashboard.
- Select the vertical ellipsis in one of the panels in the dashboard, then select Explore. The Explore screen appears. A copy of query of the panel is copied (populated) to the new screen for you to work with.
- You can now edit the copied query without breaking or changing the original query.
Save the new panel to a dashboard
When you are happy with the results of the changes you made to the copied query and the panel, you can save it to a dashboard.
- Select Add to dashboard. The Add Panel to Dashboard screen appears.
- From the Subscription dropdown list, select the subscription you want to work with.
- From the Resource groups dropdown list, select the resource group you want to work with. A list of dashboard for that resource group appears.
- Select the dashboard from the list. The dashboard screen appears with the new query and panel added to it. Alternatively, you can create a new dashboard by selecting New dashboard.
Use Explore from the dashboard gallery
- From the resource page in the Azure portal, select Dashboards with Grafana. The Explore screen appears without data.
- Select Select a resource and then select a resource from the list of resources in the subscription you are currently working with.
- Select the metric, aggregation, time grain, and dimensions for the query and panel.
- When you are happy with the query and the panel, select Add to dashboard to save it to a dashboard or create a new dashboard by selecting New dashboard.
For more information about Grafana Explore, see the Grafana documentation.
Share links to dashboards
Dashboards that you import or create require RBAC access configuration to share them with specific people or groups.
- Open the dashboard.
- Select Share. The Share Dashboard pane opens. Copy the link to the dashboard to your clipboard.
- Review sharing options:
- People with this link can edit - Enabling this option creates a link that opens the dashboard in the standard view and provides the ability to edit for users with the required dashboard write permissions. Disabling this option creates a link that opens the dashboard in a view-only mode for all users.
- Lock time range - If the dashboard is using a relative time range e.g. now-30m to now, enabling this option converts the time range in the link to an absolute time range. This enables link recipients to view the same absolute time range as used when shared.
- Keep variables - If the dashboard includes variables, enabling this option retains the current values of the variables and includes them in the generated link.
- Select Manage sharing options to use the RBAC workflow for granting view or edit access to users or groups. The Reader role is required for viewing the dashboard. Contributor is required to edit the dashboard. The link recipient will also need access to any data source used in the content of this Grafana dashboard. Monitoring Reader role is required for Azure Monitor data and Monitoring Data Reader is required for Prometheus data.
Note
'Microsoft.Dashboard/dashboard/read' and 'Microsoft.Dashboard/dashboard/write' can also be used to assign permissions with more fine-grained control.
- Copy the link to the dashboard to your clipboard.
- Paste the link into your preferred communication method to share it.
Link from one dashboard to another
Dashboard data links let you move from a summary visualization to a related dashboard while preserving context. For example, the built-in Kubernetes dashboards pass the selected cluster and namespace to a pod dashboard. Data links differ from dashboard sharing links. Sharing links provide access to a dashboard, while data links navigate from a selected value or series.
Use a built-in dashboard link
In the Azure portal, open your Azure Kubernetes Service (AKS) cluster.
Under Monitoring, select Dashboards with Grafana.
Select Kubernetes | Compute Resources | Cluster.
In the CPU Quota table, select a namespace, such as demo.
The Kubernetes | Compute Resources | Namespace (Pods) dashboard opens. The link sets var-cluster to the source cluster and var-namespace to the selected namespace.
Add a data link to a panel
Open a dashboard that you created or saved as a copy.
Open the dashboard, and then select Edit.
Hover over the panel. In the upper-right corner, select the vertical ellipsis, and then select Edit.
In the panel editor, expand Data links and actions, and then select Add link.
In Title, enter a label for the link, such as
View namespace pods.In URL, enter the target dashboard URL. Append query parameters that map values from the source dashboard to variables in the target dashboard. For example:
/d/KubernetesComputeResourcesNamespacePods/k8s-resources-namespace?${datasource:queryparam}&var-cluster=$cluster&var-namespace=${__data.fields.Namespace}This URL passes the current data source and cluster. It also sets the target dashboard's
namespacevariable to the value of theNamespacefield in the selected row. Replace the dashboard path and variable names with the values used by your target dashboard.To open the target dashboard in another browser tab, turn on Open in new tab. Then select Save.
In the panel editor toolbar, select Save to save the dashboard.
For more information about data link variables and supported visualizations, see Configure data links and actions.
Copy a dashboard to Azure Managed Grafana
From any user-saved dashboard, you can select Copy to Managed Grafana in the toolbar to copy the dashboard to an Azure Managed Grafana instance. You can copy to an existing workspace or create a new one during the process.
For detailed steps, see Copy a dashboard to Azure Managed Grafana.
Tag a dashboard
Azure Monitor dashboards with Grafana tags are managed using Azure tags. Open-source Grafana dashboard tags remain in the dashboard JSON during import and export but are not used for populating Azure tags.
To add Dashboard tags to a saved dashboard, add or update the Azure tag with the key GrafanaDashboardTags with your tag names using commas to separate entries.
Dashboards created or saved from the context of an Azure Kubernetes Service cluster automatically have the Azure tag GrafanaDashboardResourceType added. For example, dashboards created or saved from the context of an Azure Kubernetes Service cluster automatically have the Azure tag GrafanaDashboardResourceType: microsoft.ContainerService/managedClusters added. You can also add this tag to a saved dashboard to be able to access and view the dashboard in the context of AKS clusters.
Export JSON
You can export a dashboard as JSON which can be saved, imported and re-used across any Grafana instance.
- In the dashboard screen, select Export > Export as JSON.
- Save the file.
Manage a dashboard as an ARM template
Export a dashboard as an Azure Resource Manager (ARM) template. Use this template to deploy the same dashboard to another subscription or resource group and to maintain your dashboards as code.
Export a dashboard as an ARM template
- Open the dashboard in view mode.
- Select Export > Export as ARM Template. The ARM template editor opens and shows the deployment template for the dashboard.
- Review the template and edit any values that you want to change, such as the default dashboard name.
- Select Download and save the file.
To close the editor without downloading the template, select Back to dashboard. The editor also provides Help and Feedback.
Note
If the dashboard contains links to other dashboards, such as drill-down links, the editor displays a notice that the linked dashboards must be available in the target instance. Deploy the linked dashboards to the target subscription or resource group so that the links resolve. For more information, see Link from one dashboard to another.
Understand the exported template
The exported template is a standard ARM deployment template with two resources. The following example also takes the API version as a parameter, so you can set it at deployment time instead of editing the template.
| Element | Description |
|---|---|
dashboardName parameter |
The name of the dashboard to create. The default value comes from the name of the dashboard that you exported. Change this value to deploy the dashboard under a different name. |
resourceTags parameter |
The Azure tags applied to the dashboard. The tags include sourceDashboardId, which records the identifier of the dashboard that the template was exported from. |
apiVersion parameter |
The API version that both dashboard resources use. Pass the version that you want at deployment time. |
Microsoft.Dashboard/dashboards resource |
The dashboard resource. Its location is set to [resourceGroup().location], so the dashboard is created in the region of the resource group that you deploy to. |
Microsoft.Dashboard/dashboards/dashboardDefinitions resource |
A child resource whose serializedData property holds the Grafana dashboard definition, including panels, queries, and variables. |
Because dashboardName is a parameter and location follows the target resource group, you can deploy the same template to a different subscription, resource group, or region without editing the dashboard definition.
The template deploys Microsoft.Dashboard/dashboards and Microsoft.Dashboard/dashboards/dashboardDefinitions, which support different API versions. The dashboardDefinitions resource type was introduced in 2025-09-01-preview, so earlier versions don't include it. Run the following command to list the versions that each type supports, and then pass a version that appears in both lists.
az provider show --namespace Microsoft.Dashboard --query "resourceTypes[?contains(resourceType, 'dashboards')].{Type:resourceType, Versions:join(', ', apiVersions)}" --output table
The following example shows the structure of an exported template. The serializedData value is truncated.
Expand to view the exported template
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dashboardName": {
"type": "string",
"defaultValue": "<DashboardName>"
},
"resourceTags": {
"type": "object",
"defaultValue": {
"sourceDashboardId": "<SourceDashboardId>"
}
},
"apiVersion": {
"type": "string",
"defaultValue": "<ApiVersion>"
}
},
"resources": [
{
"type": "Microsoft.Dashboard/dashboards",
"apiVersion": "[parameters('apiVersion')]",
"name": "[parameters('dashboardName')]",
"location": "[resourceGroup().location]",
"tags": "[parameters('resourceTags')]",
"properties": {}
},
{
"type": "Microsoft.Dashboard/dashboards/dashboardDefinitions",
"apiVersion": "[parameters('apiVersion')]",
"name": "[format('{0}/default', parameters('dashboardName'))]",
"dependsOn": [
"[resourceId('Microsoft.Dashboard/dashboards', parameters('dashboardName'))]"
],
"properties": {
"serializedData": "{\"panels\": [...]}"
}
}
]
}
For the full property reference, see Microsoft.Dashboard/dashboards and Microsoft.Dashboard/dashboards/dashboardDefinitions.
Deploy the template to another subscription or resource group
Deploy the downloaded template by using any Resource Manager deployment method. Because the dashboard resource name must be unique within the target resource group, enter a dashboardName value if a dashboard with the same name already exists there.
Prerequisites
You need the Contributor role on the target resource group, or a role that grants the Microsoft.Dashboard/dashboards/write and Microsoft.Dashboard/dashboards/dashboardDefinitions/write permissions. Grant the dashboard's viewers access to the data sources that its panels query. For more information, see Share links to dashboards.
Deploy the template
- In the Azure portal, search for and select Deploy a custom template.
- Select Build your own template in the editor.
- Select Load file and load the downloaded template file.
- Select Save.
- On the Basics tab, select the target Subscription, Resource group, and Region, and then set Dashboard Name.
- Select Review + create.
For more information, see Deploy resources from a custom template.
Maintain dashboards as code
Store the exported template in source control and deploy changes through your existing pipeline instead of editing the dashboard in the portal. This approach lets you review dashboard changes in pull requests, roll back to an earlier version, and keep the same dashboard consistent across your development, test, and production environments.
The exported template embeds the whole dashboard definition in serializedData. Keep the template unchanged and vary the values in a parameters file for each environment.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dashboardName": {
"value": "<DashboardName>"
}
}
}
Commit one parameters file per environment next to the template, and then pass the file that matches the environment you're deploying to.
# Set variables
resourceGroupName="<TargetResourceGroupName>"
templateFile="./template-file.json"
parametersFile="./parameters-file.json"
# Deploy the dashboard by using the environment's parameters file
az deployment group create \
--resource-group "$resourceGroupName" \
--template-file "$templateFile" \
--parameters "@$parametersFile"
For more information, see Create parameters files for ARM template deployment.
To track when a dashboard is updated to a new version or restored to a previous one, see Add diagnostic settings.
Add diagnostic settings
You can configure diagnostic settings for your Azure Monitor dashboard to track when it was updated to a new version or restored to a previous one.
You can create up to five different diagnostic settings to send the logs to independent destinations.
From the dashboard screen, in the left menu, select Monitoring > Diagnostic settings.
In the Diagnostic settings page, select + Add diagnostic setting.
For Diagnostic setting name, enter a unique name.
Under Logs, select allLogs from among the following options:
Logs categories Description audit Streams all audit logs. Selecting this option is the same as choosing allLogs, since Update Events are audit logs, and are currently the only logs available. allLogs Streams all logs. Update Events Streams all update events. AllMetrics Streams all metrics. Currently not supported. Under Destination details, select one or more destinations, fill out details, and select Save.
Destination Description Settings Log Analytics workspace Send data to a Log Analytics workspace Select the subscription containing an existing Log Analytics workspace, then select the Log Analytics workspace Storage account Archive data to a storage account Select the subscription containing an existing storage account, then select the storage account. Only storage accounts in the same region as the Grafana dashboard are displayed in the dropdown menu. Event hub Stream to an event hub Select a subscription and an existing Azure Event Hubs namespace. Optionally also choose an existing event hub. Choose an event hub policy from the list. Only event hubs in the same region as the Grafana dashboard are displayed in the dropdown menu. Partner solution Send to a partner solution Select a subscription and a destination. For more information about available destinations, go to partner destinations.
After you create a diagnostic setting, data should start flowing to your selected destinations within 90 minutes.