Skip to content

Commit 54263db

Browse files
authored
Merge pull request #164505 from lgayhardt/azmonworkbokstextparm0721
Azmon Workbooks text
2 parents 9f59c25 + ee67caa commit 54263db

File tree

9 files changed

+52
-13
lines changed

9 files changed

+52
-13
lines changed
15.8 KB
Loading
6.08 KB
Loading
16.1 KB
Loading
6.28 KB
Loading
4.43 KB
Loading
-43.6 KB
Loading
-34.7 KB
Loading
69 KB
Loading

articles/azure-monitor/visualize/workbooks-text.md

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,59 @@
22
title: Azure Monitor workbooks text parameters
33
description: Simplify complex reporting with prebuilt and custom parameterized workbooks. Learn more about workbook text parameters.
44
services: azure-monitor
5-
manager: carmonm
65

76
ms.workload: tbd
87
ms.tgt_pltfrm: ibiza
98
ms.topic: conceptual
10-
ms.date: 10/23/2019
9+
ms.date: 07/02/2021
1110
---
1211

1312
# Workbook text parameters
1413

15-
Textbox parameters provide a simple way to collect text input from workbook users. They are used when it is not practical to use a drop-down to collect the input (for example, an arbitrary threshold or generic filters). Workbooks allow authors to get the default value of the textbox from a query. This allows interesting scenarios like setting the default threshold based on the p95 of the metric.
14+
Textbox parameters provide a simple way to collect text input from workbook users. They're used when it isn't practical to use a drop-down to collect the input (for example, an arbitrary threshold or generic filters). Workbooks allow authors to get the default value of the textbox from a query. This allows interesting scenarios like setting the default threshold based on the p95 of the metric.
1615

17-
A common use of textboxes is as internal variables used by other workbook controls. This is done by leveraging a query for default values, and making the input control invisible in read-mode. For example, a user may want a threshold to come from a formula (not a user) and then use the threshold in subsequent queries.
16+
A common use of textboxes is as internal variables used by other workbook controls. This is done by using a query for default values, and making the input control invisible in read-mode. For example, a user may want a threshold to come from a formula (not a user) and then use the threshold in subsequent queries.
1817

1918
## Creating a text parameter
2019
1. Start with an empty workbook in edit mode.
2120
2. Choose _Add parameters_ from the links within the workbook.
22-
3. Click on the blue _Add Parameter_ button.
21+
3. Select on the blue _Add Parameter_ button.
2322
4. In the new parameter pane that pops up enter:
2423
1. Parameter name: `SlowRequestThreshold`
2524
2. Parameter type: `Text`
2625
3. Required: `checked`
27-
4. Get default value from query: `unchecked`
26+
4. Get data from: `None`
2827
5. Choose 'Save' from the toolbar to create the parameter.
2928

30-
![Image showing the creation of a text parameter](./media/workbooks-text/text-create.png)
29+
:::image type="content" source="./media/workbooks-text/text-create.png" alt-text="Screenshot showing the creation of a text parameter.":::
3130

3231
This is how the workbook will look like in read-mode.
3332

34-
![Image showing a text parameter in read mode](./media/workbooks-text/text-readmode.png)
33+
:::image type="content" source="./media/workbooks-text/text-readmode.png" alt-text="Screenshot showing a text parameter in read mode." border="false":::
34+
35+
## Parameter field style
36+
Text parameter supports following field style:
37+
38+
- Standard: A single line text field.
39+
40+
:::image type="content" source="./media/workbooks-text/standard-text.png" alt-text="Screenshot showing standard text field.":::
41+
42+
- Password: A single line password field. The password value is only hidden on UI when user types. The value is still fully accessible as a param value when referred and it's stored unencrypted when workbook is saved.
43+
44+
:::image type="content" source="./media/workbooks-text/password-text.png" alt-text="Screenshot showing password field.":::
45+
46+
- Multiline: A multiline text field with support of rich intellisense and syntax colorization for following languages:
47+
- Text
48+
- Markdown
49+
- JSON
50+
- SQL
51+
- TypeScript
52+
- KQL
53+
- TOML
54+
55+
User can also specify the height for the multiline editor.
56+
57+
:::image type="content" source="./media/workbooks-text/kql-text.png" alt-text="Screenshot showing multiline text field.":::
3558

3659
## Referencing a text parameter
3760
1. Add a query control to the workbook by selecting the blue `Add query` link and select an Application Insights resource.
@@ -51,20 +74,20 @@ This is how the workbook will look like in read-mode.
5174
```
5275
4. Run query to see the results
5376
54-
![Image showing a text parameter referenced in KQL](./media/workbooks-text/text-reference.png)
77+
:::image type="content" source="./media/workbooks-text/text-reference.png" alt-text="Screenshot showing a text parameter referenced in KQL.":::
5578
5679
> [!NOTE]
5780
> In the example above, `{SlowRequestThreshold}` represents an integer value. If you were querying for a string like `{ComputerName}` you would need to modify your Kusto query to add quotes `"{ComputerName}"` in order for the parameter field to an accept input without quotes.
5881
59-
## Setting default values
82+
## Setting default values using queries
6083
1. Start with an empty workbook in edit mode.
6184
2. Choose _Add parameters_ from the links within the workbook.
62-
3. Click on the blue _Add Parameter_ button.
85+
3. Select on the blue _Add Parameter_ button.
6386
4. In the new parameter pane that pops up enter:
6487
1. Parameter name: `SlowRequestThreshold`
6588
2. Parameter type: `Text`
6689
3. Required: `checked`
67-
4. Get default value from query: `checked`
90+
4. Get data from: `Query`
6891
5. In the KQL box, add this snippet:
6992
```kusto
7093
requests
@@ -74,11 +97,27 @@ This is how the workbook will look like in read-mode.
7497
6. Run query to see the result
7598
7. Choose 'Save' from the toolbar to create the parameter.
7699
77-
![Image showing a text parameter with default value from KQL](./media/workbooks-text/text-default-value.png)
100+
:::image type="content" source="./media/workbooks-text/text-default-value.png" alt-text="Screenshot showing a text parameter with default value from KQL.":::
78101
79102
> [!NOTE]
80103
> While this example queries Application Insights data, the approach can be used for any log based data source - Log Analytics, Azure Resource Graph, etc.
81104
105+
## Adding validations
106+
107+
For standard and password text parameters, user can add validation rules that are applied to the text field. Add a valid regex with error message. If message is set, it's shown as error when field is invalid.
108+
109+
If match is selected, the field is valid if value matches the regex and if match isn't selected then the field is valid if it doesn't match the regex.
110+
111+
:::image type="content" source="./media/workbooks-text/validation-settings.png" alt-text="Screenshot of text validation settings.":::
112+
113+
## Format JSON data
114+
115+
If JSON is selected as the language for the multiline text field, then the field will have a button that will format the JSON data of the field. User can also use the shortcut `(ctrl + \)` to format the JSON data.
116+
117+
If data is coming from a query, user can select the option to pre-format the JSON data returned by the query.
118+
119+
:::image type="content" source="./media/workbooks-text/pre-format-json-data.png" alt-text="Screenshot of pre-format JSON data.":::
120+
82121
## Next steps
83122
84123
* [Get started](./workbooks-overview.md#visualizations) learning more about workbooks many rich visualizations options.

0 commit comments

Comments
 (0)