Skip to content

Commit 88b2d1e

Browse files
Merge pull request #221193 from v-jbasden/jbasden-add-workbooks-content
Adding workbooks content
2 parents 096f2ae + fd2bb66 commit 88b2d1e

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

articles/azure-monitor/visualize/workbooks-create-workbook.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,52 @@ To add a query to an Azure Workbook:
125125
```
126126
127127
In this case, the query returns no rows if the **AzureDiagnostics** table is missing, or if the **ResourceId** column is missing from the table.
128+
129+
### Tutorial - resource centric logs queries in workbooks
130+
131+
This video shows you how to use resource level logs queries in Azure Workbooks. It also has tips and tricks on how to enable advanced scenarios and improve performance.
132+
133+
[![Making resource centric log queries in workbooks](https://img.youtube.com/vi/8CvjM0VvOA8/0.jpg)](https://youtu.be/8CvjM0VvOA8 "Video showing how to make resource centric log queries in workbooks")
134+
135+
#### Dynamic resource type parameter
136+
Uses dynamic scopes for more efficient querying. The snippet below uses this heuristc:
137+
1. _Individual resources_: if the count of selected resource is less than or equal to 5
138+
2. _Resource groups_: if the number of resources is over 5 but the number of resource groups the resources belong to is less than or equal to 3
139+
3. _Subscriptions_: otherwise
140+
141+
```
142+
Resources
143+
| take 1
144+
| project x = dynamic(["microsoft.compute/virtualmachines", "microsoft.compute/virtualmachinescalesets", "microsoft.resources/resourcegroups", "microsoft.resources/subscriptions"])
145+
| mvexpand x to typeof(string)
146+
| extend jkey = 1
147+
| join kind = inner (Resources
148+
| where id in~ ({VirtualMachines})
149+
| summarize Subs = dcount(subscriptionId), resourceGroups = dcount(resourceGroup), resourceCount = count()
150+
| extend jkey = 1) on jkey
151+
| project x, label = 'x',
152+
selected = case(
153+
x in ('microsoft.compute/virtualmachinescalesets', 'microsoft.compute/virtualmachines') and resourceCount <= 5, true,
154+
x == 'microsoft.resources/resourcegroups' and resourceGroups <= 3 and resourceCount > 5, true,
155+
x == 'microsoft.resources/subscriptions' and resourceGroups > 3 and resourceCount > 5, true,
156+
false)
157+
```
158+
#### Static resource scope for querying multiple resource types
159+
```json
160+
[
161+
{ "value":"microsoft.compute/virtualmachines", "label":"Virtual machine", "selected":true },
162+
{ "value":"microsoft.compute/virtualmachinescaleset", "label":"Virtual machine scale set", "selected":true }
163+
]
164+
```
165+
#### Resource parameter grouped by resource type
166+
```
167+
Resources
168+
| where type =~ 'microsoft.compute/virtualmachines' or type =~ 'microsoft.compute/virtualmachinescalesets'
169+
| where resourceGroup in~({ResourceGroups})
170+
| project value = id, label = id, selected = false,
171+
group = iff(type =~ 'microsoft.compute/virtualmachines', 'Virtual machines', 'Virtual machine scale sets')
172+
```
173+
128174
## Add parameters
129175

130176
You can collect input from consumers and reference it in other parts of the workbook using parameters. Use parameters to scope the result set or to set the right visual. Parameters help you build interactive reports and experiences. For more information on how parameters can be used, see [workbook parameters](workbooks-parameters.md).

articles/azure-monitor/visualize/workbooks-data-sources.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ You can use Kusto query language (KQL) queries that transform the underlying res
3939

4040
You can easily query across multiple resources to create a unified rich reporting experience.
4141

42+
See also: [Log Analytics query optimization tips](../logs/query-optimization.md)
43+
44+
See also: [Workbooks best practices and hints for logs queries](workbooks-create-workbook.md#best-practices-for-querying-logs)
45+
46+
Tutorial: [Making resource centric log queries in workbooks](workbooks-create-workbook.md#tutorial---resource-centric-logs-queries-in-workbooks)
47+
4248
## Metrics
4349

4450
Azure resources emit [metrics](../essentials/data-platform-metrics.md) that can be accessed via workbooks. Metrics can be accessed in workbooks through a specialized control that allows you to specify the target resources, the desired metrics, and their aggregation. You can then plot this data in charts or grids.
@@ -71,6 +77,8 @@ For the **Cluster Name** field, add the region name following the cluster name.
7177

7278
![Screenshot that shows Kusto query window.](./media/workbooks-data-sources/data-explorer.png)
7379

80+
See also: [Azure Data Explorer query best practices](/azure/data-explorer/kusto/query/best-practices)
81+
7482
## JSON
7583

7684
The JSON provider allows you to create a query result from static JSON content. It's most commonly used in parameters to create dropdown parameters of static values. Simple JSON arrays or objects will automatically be converted into grid rows and columns. For more specific behaviors, you can use the **Results** tab and JSONPath settings to configure columns.
@@ -112,6 +120,10 @@ Workbooks support these merges:
112120
* Union
113121
* Duplicate table
114122

123+
### Merge examples
124+
125+
[Using the Duplicate Table option to reuse queried data](workbooks-commonly-used-components.md#reuse-query-data-in-different-visualizations)
126+
115127
## Custom endpoint
116128

117129
Workbooks support getting data from any external source. If your data lives outside Azure, you can bring it to workbooks by using this data source type.

0 commit comments

Comments
 (0)