Resource parameters allow picking of resources in workbooks. This is useful in setting the scope from which to get the data from. An example is allowing users to select the set of VMs which the charts later will use when presenting the data.
Values from resource pickers can come from the workbook context, static list or from Azure Resource Graph queries.
- Start with an empty workbook in edit mode.
- Choose Add parameters from the links within the workbook.
- Click on the blue Add Parameter button.
- In the new parameter pane that pops up enter:
- Parameter name:
Applications
- Parameter type:
Resource picker
- Required:
checked
- Allow multiple selections:
checked
- Parameter name:
- Get data from:
Workbook Resources
- Include only resource types:
Application Insights
- Choose 'Save' from the toolbar to create the parameter.
- Start with an empty workbook in edit mode.
- Choose Add parameters from the links within the workbook.
- Click on the blue Add Parameter button.
- In the new parameter pane that pops up enter:
- Parameter name:
Applications
- Parameter type:
Resource picker
- Required:
checked
- Allow multiple selections:
checked
- Parameter name:
- 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 = name, selected = false, group = resourceGroup
- Query Type:
- Choose 'Save' from the toolbar to create the parameter.
Note that Azure Resource Graph is not yet available in all clouds. Ensure that it is supported in your target cloud if you choose this approach.
Azure Resource Graph documentation
- Start with an empty workbook in edit mode.
- Choose Add parameters from the links within the workbook.
- Click on the blue Add Parameter button.
- In the new parameter pane that pops up enter:
- Parameter name:
Applications
- Parameter type:
Resource picker
- Required:
checked
- Allow multiple selections:
checked
- Parameter name:
- Get data from:
JSON
- In the content control, add this json snippet
[ { "value":"/subscriptions/<sub-id>/resourceGroups/<resource-group>/providers/<resource-type>/acmeauthentication", "label": "acmeauthentication", "selected":true, "group":"Acme Backend" }, { "value":"/subscriptions/<sub-id>/resourceGroups/<resource-group>/providers/<resource-type>/acmeweb", "label": "acmeweb", "selected":false, "group":"Acme Frontend" } ]
- Use the blue Update button.
- Optionally set the
Include only resource types
to Application Insights - Choose 'Save' from the toolbar to create the parameter.
- Add a query control to the workbook and select an Application Insights resource.
- Use the Application Insights drop down to bind the parameter to the control. Doing this sets the scope of the query to the resources returned by the parameter at run time.
- In the KQL control, add this snippet
requests | summarize Requests = count() by appName, name | order by Requests desc
- Run query to see the results.
This approach can be used to bind resources to other controls like metrics.
Parameter | Explanation | Example |
---|---|---|
{Applications} |
The selected resource id | /subscriptions//resourceGroups//providers//acmeauthentication |
{Applications:label} |
The label of the selected resource | acmefrontend |
{Applications:value} |
The value of the selected resource | '/subscriptions//resourceGroups//providers//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:subscriptionid} |
The subscription guid id of a subscription or resource | |
{Applications:subid} |
The subscription guid id of a subscription or resource with ' quote | |
{Applications:id} |
The guid id of a subscription | |
{Applications:grid} |
A grid showing the resource properties. Useful to render in a text block while debugging |
See also: