Grafana Cloud Enterprise Open source
Last reviewed: August 11, 2026

Azure Monitor template variables

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.

For an introduction to templating and template variables, refer to the Templating and Add and manage variables.

Before you begin

Create a template variable

To create a template variable for Azure Monitor:

  1. Navigate to the dashboard you want to update and click Edit.
  2. Click the Add new element icon (blue plus sign).
  3. Click Variable.
  4. Select Query as the variable type.
  5. Enter a Name for your variable (for example, subscription, resourceGroup, or resource).
  6. Select an option in the Display drop-down list to control where on the dashboard the variable is displayed.
  7. Click Open variable editor to open the Query Variable dialog box.
  8. In the Data source drop-down list, select your Azure Monitor data source.
  9. In the Query Type drop-down list, select the appropriate query type (refer to Available query types).
  10. Configure any additional fields required by the selected query type.
  11. Click Preview to preview the variable values.
  12. Click Close to close the query variable editor dialog box.
  13. Configure display options such as Multi-value, Include All value, or Allow custom values as needed.
  14. Click Save.
  15. (Optional) Enter a description of the changes you’ve made.
  16. Click Save.
  17. Click Exit edit.

Available query types

The Azure Monitor data source provides the following query types for template variables: