Menu
Grafana Cloud
Enterprise
Open source
Last reviewed: August 11, 2026Azure 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
- Ensure you have configured the Azure Monitor data source.
- If you want template variables to auto-populate subscriptions, set a Default Subscription in the data source configuration.
Create a template variable
To create a template variable for Azure Monitor:
- Navigate to the dashboard you want to update and click Edit.
- Click the Add new element icon (blue plus sign).
- Click Variable.
- Select Query as the variable type.
- Enter a Name for your variable (for example,
subscription,resourceGroup, orresource). - Select an option in the Display drop-down list to control where on the dashboard the variable is displayed.
- Click Open variable editor to open the Query Variable dialog box.
- In the Data source drop-down list, select your Azure Monitor data source.
- In the Query Type drop-down list, select the appropriate query type (refer to Available query types).
- Configure any additional fields required by the selected query type.
- Click Preview to preview the variable values.
- Click Close to close the query variable editor dialog box.
- Configure display options such as Multi-value, Include All value, or Allow custom values as needed.
- Click Save.
- (Optional) Enter a description of the changes you’ve made.
- Click Save.
- Click Exit edit.
Available query types
The Azure Monitor data source provides the following query types for template variables: