Workbook resource parameters
Resource parameters allow picking of resources in workbooks. This functionality is useful in setting the scope from which to get the data. An example would be allowing you to select the set of VMs, which charts use later when presenting the data.
Values from resource pickers can come from the workbook context, static list, or Azure Resource Graph queries.
Note
The label for each resource in the resource parameter list is based on the resource id. You cannot replace that name with another value. For clarity, the examples in this document show the label field set to the id, but that value isn't used in the actual parameter.
Create a resource parameter (workbook resources)
Start with an empty workbook in edit mode.
Select Add parameters > Add Parameter.
In the new parameter pane that opens, enter:
- Parameter name:
Applications
- Parameter type:
Resource picker
- Required:
checked
- Allow multiple selections:
checked
- Get data from:
Workbook Resources
- Include only resource types:
Application Insights
- Parameter name:
Select Save to create the parameter.
Create an Azure Resource Graph resource parameter
Start with an empty workbook in edit mode.
Select Add parameters > Add Parameter.
In the new parameter pane that opens, enter:
- Parameter name:
Applications
- Parameter type:
Resource picker
- Required:
checked
- Allow multiple selections:
checked
- Get data from:
Query
- Query Type:
Azure Resource Graph
- Subscriptions:
Use default subscriptions
- In the query control, add this snippet:
where type == 'microsoft.insights/components' | project value = id, label = id, selected = false, group = resourceGroup
- Parameter name:
Select Save to create the parameter.
For more information on Azure Resource Graph, see What is Azure Resource Graph?.
Create a JSON list resource parameter
- Start with an empty workbook in edit mode.
- Select Add parameters > Add Parameter.
- In the new parameter pane that opens, enter:
Parameter name:
Applications
Parameter type:
Resource picker
Required:
checked
Allow multiple selections:
checked
Get data from:
JSON
In the content control, add this JSON snippet:
[ { "value":"/subscriptions/<sub-id>/resourceGroups/<resource-group>/providers/<resource-type>/acmeauthentication", "selected":true, "group":"Acme Backend" }, { "value":"/subscriptions/<sub-id>/resourceGroups/<resource-group>/providers/<resource-type>/acmeweb", "selected":false, "group":"Acme Frontend" } ]
Select Update.
- Optionally, set
Include only resource types
to Application Insights. - Select Save to create the parameter.
Reference a resource parameter
Select Add query to add a query control, and then select an Application Insights resource.
Use the Application Insights dropdown list to bind the parameter to the control. This step sets the scope of the query to the resources returned by the parameter at runtime.
In the KQL control, add this snippet:
requests | summarize Requests = count() by appName, name | order by Requests desc
Run the query to see the results.
This approach can be used to bind resources to other controls like metrics.
Resource parameter options
Parameter | Description | Example |
---|---|---|
{Applications} |
The selected resource ID. | /subscriptions/<sub-id>/resourceGroups/<resource-group>/providers/<resource-type>/acmeauthentication |
{Applications:label} |
The label of the selected resource. | acmefrontend Note: for multi-value resource parameters, this label may be shortened like acmefrontend (+3 others) and may not include all labels of all selected values |
{Applications:value} |
The value of the selected resource. | '/subscriptions/<sub-id>/resourceGroups/<resource-group>/providers/<resource-type>/acmeauthentication' |
{Applications:name} |
The name of the selected resource. | acmefrontend |
{Applications:resourceGroup} |
The resource group of the selected resource. | acmegroup |
{Applications:resourceType} |
The type of the selected resource. | microsoft.insights/components |
{Applications:subscription} |
The subscription of the selected resource. | |
{Applications:grid} |
A grid that shows the resource properties. Useful to render in a text block while debugging. |