Recently, while developing a new Azure workbook for visualization we had a requirement to provide color coding based upon specific information that was available only in a text field. Specifically, we had a variety of backup conditions that we checked for in our Kusto query that needed to be visualized either with Red (critical), Yellow (warning), or Green (healthy). An example of the completed output is shown below where two columns have been configured to color code based on the values (BackupState and Comments).
To configure color coding, choose the relevant field (in this case we’ll start with the example field Comments) and change the Column renderer to Thresholds.
TIP: To add the value you want to check for go to the second line and fill that in (circled in yellow below):
Next, change the Threshold Settings to Colors from Icons (shown above), and add the field which will be colored Red. Then set the default to None for the color as shown below.
The completed Thresholds configuration is shown below where it will be red in the coloration of it has “Could Not Connect To Instance” and it will be uncolored if it does not have this value.
The final version of this is shown below where those records which have “Could Not Connect to Instance” in the comment field were set to red as shown below.
We can also add a coloration for a healthy condition such as in the example below where “Empty Row Set” is a healthy condition.
Here’s what it looked like once we added logic that “Empty Row Set” in the comment field is set to green.
As soon as you fill out the first field on the second line (in this case choosing == as the value), it moves it this to the first line.
Once this is moved to the top line you can set the values as shown below.
Below is the completed query with colors for both Green and Red values.
Reference link, thanks, and next steps
- Microsoft has provided some excellent documentation on how to do a similar process using icons instead of colors which is available here: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/workbooks-grid-visualizations#icons-to-represent-status
- Thank you to John Gardner, and Oleg Ananiev who pointed me in the correct direction for this requirement as well as providing the reference link provided above.
- In the second part of this blog series, I will showcase how to use Kusto to identify multiple conditions that impact the color of a specific field in a workbook using the BackupState example shown at the start of this blog post.
Summary: To color code results in workbooks (including text values) use the column settings and choose the thresholds option.