Skip to content

Commit aec2fea

Browse files
committed
Updated images and changes per Ornat's comments
1 parent 75c94e2 commit aec2fea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+82
-84
lines changed

articles/data-explorer/flow-usage.md

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: orspod
55
ms.author: orspodek
66
ms.reviewer: dorcohen
77
ms.service: data-explorer
8-
ms.topic: example-scenario
8+
ms.topic: conceptual
99
ms.date: 03/15/2020
1010
---
1111

@@ -15,48 +15,46 @@ The Microsoft Flow connector enables you to run Kusto queries and commands autom
1515

1616
For more information, see [Microsoft Flow connector (Preview)](flow.md).
1717

18-
## Usage examples
18+
* [Microsoft Flow connector and SQL](#microsoft-flow-connector-and-sql)
19+
* [Push data to Power BI dataset](#push-data-to-power-bi-dataset)
20+
* [Conditional queries](#conditional-queries)
21+
* [Email multiple Azure Data Explorer Flow charts](#email-multiple-azure-data-explorer-flow-charts)
22+
* [Send a different email to different contacts](#send-a-different-email-to-different-contacts)
23+
* [Create a custom HTML table](#create-a-custom-html-table)
1924

20-
1. [Microsoft Flow connector and SQL](#example-1-microsoft-flow-connector-and-sql)
21-
1. [Push data to Power BI dataset](#example-2-push-data-to-power-bi-dataset)
22-
1. [Conditional queries](#example-3-conditional-queries)
23-
1. [Email multiple Azure Data Explorer Flow charts](#example-4-email-multiple-azure-data-explorer-flow-charts)
24-
1. [Send a different email to different contacts](#example-5-send-a-different-email-to-different-contacts)
25-
1. [Create a custom HTML table](#example-6-create-a-custom-html-table)
26-
27-
## Example 1: Microsoft Flow connector and SQL
25+
## Microsoft Flow connector and SQL
2826

2927
Use the Microsoft Flow connector to query your data and aggregate it in an SQL database.
3028

3129
> [!Note]
3230
> SQL insert is done separately for each row. Only use the Microsoft Flow connector for small amounts of output data.
3331
34-
![alt text](./Media/flow/flow-sqlexample.png "flow-sqlexample")
32+
![Flow SQL example](./Media/flow-usage/flow-sqlexample.png "Flow SQL example")
3533

3634
> [!IMPORTANT]
3735
> In the *Cluster Name* field, enter the cluster URL.
3836
39-
## Example 2: Push data to Power BI dataset
37+
## Push data to Power BI dataset
4038

4139
The Microsoft Flow connector can be used together with the Power BI connector to push data from Kusto queries to Power BI streaming datasets.
4240

43-
1. Create a new *Run query and list results* action.
41+
1. Create a new Run query and list results action.
4442
1. Select **New step**.
45-
1. Select **Add an action** and search for *Power BI*.
43+
1. Select **Add an action** and search for Power BI.
4644
1. Select **Power BI**.
4745
1. Select **Add rows to a dataset**.
4846

49-
![alt text](./Media/flow/flow-powerbiconnector.png "flow-powerbiconnector")
50-
1. Enter the *Workspace*, *Dataset*, and *Table* to which data will be pushed.
51-
1. From the dynamic content dialog, add a *Payload* containing your dataset schema and the relevant Kusto query results.
47+
![Flow Power BI connector](./Media/flow-usage/flow-powerbiconnector.png "Flow Power BI connector")
48+
1. Enter the Workspace, Dataset, and Table to which data will be pushed.
49+
1. From the dynamic content dialog, add a Payload containing your dataset schema and the relevant Kusto query results.
5250

53-
![alt text](./Media/flow/flow-powerbifields.png "flow-powerbifields")
51+
![Flow Power BI fields](./Media/flow-usage/flow-powerbifields.png "Flow Power BI fields")
5452

5553
Flow automatically applies the Power BI action for each row of the Kusto query result table.
5654

57-
![alt text](./Media/flow/flow-powerbiforeach.png "flow-powerbiforeach")
55+
![Flow Power BI action for each row](./Media/flow-usage/flow-powerbiforeach.png "Flow Power BI action for each row")
5856

59-
## Example 3: Conditional queries
57+
## Conditional queries
6058

6159
The results of Kusto queries can be used as input or conditions for the next flow actions.
6260

@@ -65,123 +63,122 @@ For each incident that is still active, Kusto is queried for more information ab
6563

6664
Follow these instructions to create a similar Flow:
6765

68-
1. Create a new *Run query and list results* action.
66+
1. Create a new Run query and list results action.
6967
1. Select **New step**.
7068
1. Select **Condition control**.
7169
1. From the dynamic content window, select the parameter you want to use as a condition for next actions.
7270
1. Select the type of *Relationship* and *Value* to set a specific condition on the given parameter.
7371

74-
![alt text](./Media/flow/flow-condition.png "flow-condition")
72+
![Flow conditions](./Media/flow-usage/flow-condition.png "Flow conditions")(./Media/flow-usage/flow-condition.png#lightbox)
7573

7674
Flow applies this condition on each row of the query result table.
7775
1. Add actions for when the condition is true and false.
7876

79-
![alt text](./Media/flow/flow-conditionactions.png "flow-conditionactions")
77+
![Flow condition actions](./Media/flow-usage/flow-conditionactions.png "Flow condition actions")(./Media/flow-usage/flow-conditionactions.png#lightbox)
8078

8179
You can use the result values from the Kusto query as input for the next actions. Select the result values from the dynamic content window.
82-
In the example below, a *Slack - Post Message* action and *Visual Studio - Create a new work item* action containing data from the Kusto query were added.
80+
In the example below, a Slack - Post Message action and Visual Studio - Create a new work item action containing data from the Kusto query were added.
8381

84-
![alt text](./Media/flow/flow-slack.png "flow-slack")
82+
![Slack - Post Message action](./Media/flow-usage/flow-slack.png "Slack - Post Message action")
8583

86-
![alt text](./Media/flow/flow-visualstudio.png "flow-visualstudio")
84+
![Visual Studio action](./Media/flow-usage/flow-visualstudio.png "Visual Studio action")
8785

8886
In this example, if an incident is still active, query Kusto again to get information on how incidents from the same source were solved in the past.
8987

90-
![alt text](./Media/flow/flow-conditionquery.png "flow-conditionquery")
88+
![Flow condition query](./Media/flow-usage/flow-conditionquery.png "Flow condition query")
9189

9290
> [!IMPORTANT]
9391
> In the *Cluster Name* field, enter the cluster URL.
9492
9593
Visualize this information as a pie chart and email it to the team.
9694

97-
![alt text](./Media/flow/flow-conditionemail.png "flow-conditionemail")
95+
![Flow condition email](./Media/flow-usage/flow-conditionemail.png "Flow condition email")
9896

99-
## Example 4: Email multiple Azure Data Explorer Flow charts
97+
## Email multiple Azure Data Explorer Flow charts
10098

10199
1. Create a new Flow with "Recurrence" trigger, and define the interval of the Flow and the frequency.
102-
1. Add a new step, with one or more *Kusto - Run query and visualize results* actions.
100+
1. Add a new step, with one or more Kusto - Run query and visualize results actions.
103101

104-
![alt text](./Media/flow/flow-severalqueries.png "flow-severalqueries")
105-
1. For each *Kusto - Run query and visualize result*, define the following fields:
102+
![Run several queries in a flow](./Media/flow-usage/flow-severalqueries.png "Run several queries in a flow")
103+
1. For each*Kusto - Run query and visualize result, define the following fields:
106104
* Cluster URL (in the *Cluster Name* field)
107105
* Database Name
108106
* Query and Chart Type (HTML Table/ Pie Chart/ Time Chart/ Bar Chart/ Enter Custom Value).
109107

110-
![alt text](./Media/flow/flow-visualizeresultsmultipleattachments.png "flow-visualizeresultsmultipleattachments")
108+
![Visualize results with multiple attachments](./Media/flow-usage/flow-visualizeresultsmultipleattachments.png "Visualize results with multiple attachments")
111109

112110
> [!IMPORTANT]
113111
> In the *Cluster Name* fields, enter the cluster URL.
114112
115-
1. Add a *Send an email* action.
116-
* In the *Body* field, insert the required *body* so that the visualized result of the query is included in the body of the email.
117-
* To add an attachment to the email, add *Attachment Name* and *Attachment Content*.
118-
![alt text](./Media/flow/flow-emailmultipleattachments.png "flow-emailmultipleattachments")
113+
1. Add a Send an email action.
114+
* In the *Body* field, insert the required body so that the visualized result of the query is included in the body of the email.
115+
* To add an attachment to the email, add Attachment Name and Attachment Content.
116+
![Email multiple attachments](./Media/flow-usage/flow-emailmultipleattachments.png "Email multiple attachments")
119117

120118
Results:
121119

122-
![alt text](./Media/flow/flow-resultsmultipleattachments.png "flow-resultsmultipleattachments")
120+
![Results of multiple attachments](./Media/flow-usage/flow-resultsmultipleattachments.png "Results of multiple attachments")(./Media/flow-usage/flow-resultsmultipleattachments.png#lightbox)
123121

124-
![alt text](./Media/flow/flow-resultsmultipleattachments2.png "flow-resultsmultipleattachments2")
122+
![Results of multiple attachments](./Media/flow-usage/flow-resultsmultipleattachments2.png "Results of multiple attachments")(./Media/flow-usage/flow-resultsmultipleattachments2.png#lightbox)
125123

126-
## Example 5: Send a different email to different contacts
124+
## Send a different email to different contacts
127125

128126
You can leverage Microsoft Flow to send different customized emails to different contacts. The email addresses and the email contents are a result of a Kusto query.
129127

130128
Example:
131129

132-
![alt text](./Media/flow/flow-dynamicemailkusto.png "flow-dynamicemailkusto")
130+
![Dynamic email using a Kusto query](./Media/flow-usage/flow-dynamicemailkusto.png "Dynamic email using a Kusto query")
133131

134132
> [!IMPORTANT]
135133
> In the *Cluster Name* field, enter the cluster URL.
136134
137-
![alt text](./Media/flow/flow-dynamicemail.png "flow-dynamicemail")
135+
![Dynamic email in the flow action](./Media/flow-usage/flow-dynamicemail.png "Dynamic email in the flow action")
138136

139-
## Example 6: Create a custom HTML table
137+
## Create a custom HTML table
140138

141139
You can leverage Microsoft Flow to create and use custom HTML elements, such as a custom HTML table.
142140

143141
The following example demonstrates how to create a custom HTML table. The HTML table will have its rows colored by log level (the same as in Azure Data Explorer).
144142

145143
Follow these instructions to create a similar Flow:
146144

147-
1. Create a new *Kusto - Run query and list results* action.
145+
1. Create a new Kusto - Run query and list results action.
148146

149-
![alt text](./Media/flow/flow-listresultforhtmltable.png "flow-listresultforhtmltable")
147+
![List results for an HTML table](./Media/flow-usage/flow-listresultforhtmltable.png "List results for an HTML table")
150148

151149
> [!IMPORTANT]
152150
> In the *Cluster Name* field, enter the cluster URL.
153151
154152
1. Loop over the query results and create the HTML table body:
155153
1. To create a variable to hold the HTML string, select **New step**
156-
1. Select **Add an action** and search for *Variables*.
154+
1. Select **Add an action** and search for Variables.
157155
1. Select **Variables - Initialize variable**.
158156
1. Initialize a string variable as follows:
159157

160-
![alt text](./Media/flow/flow-initializevariable.png "flow-initializevariable")
158+
![Initialize a variable](./Media/flow-usage/flow-initializevariable.png "Initialize a variable")
161159

162160
1. Loop over the results:
163161
1. Select **New step**.
164162
1. Select **Add an action**.
165-
1. Search for *Variables*.
163+
1. Search for Variables.
166164
1. Select **Variables - Append to string variable**.
167165
1. Select the variable name that you initialized before, and create the HTML table rows using the query results.
168-
When selecting the query results, *Apply to each* is automatically added.
166+
When selecting the query results, Apply to each is automatically added.
169167

170168
In the example below, the `if` expression is used to define the style of each row:
171169

172170
```if(equals(items('Apply_to_each')?['Level'], 'Warning'), 'Yellow', if(equals(items('Apply_to_each')?['Level'], 'Error'), 'red', 'white'))```
173171

174-
![alt text](./Media/flow/flow-createhtmltableloopcontent.png "flow-createhtmltableloopcontent")
172+
![Create HTML table loop content](./Media/flow-usage/flow-createhtmltableloopcontent.png "Create HTML table loop content")(./Media/flow-usage/flow-createhtmltableloopcontent.png#lightbox)
175173

176174
1. Create the full HTML content:
177-
1. Add a new action outside *Apply to each*.
178-
In the following example the action used is *Send an email*.
175+
1. Add a new action outside Apply to each.
176+
In the following example the action used is Send an email.
179177
1. Define your HTML table using the variable from the previous steps.
180-
1. If you're sending an email, select **Show advanced options** and, under *Is HTML*, select **Yes**.
178+
1. If you're sending an email, select **Show advanced options** and, under Is HTML, select **Yes**.
181179

182-
![alt text](./Media/flow/flow-customhtmltablemail.png "flow-customhtmltablemail")
180+
![Custom HTML table email](./Media/flow-usage/flow-customhtmltablemail.png "Custom HTML table email")
183181

184182
Result:
185183

186-
![alt text](./Media/flow/flow-customhtmltableresult.png "flow-customhtmltableresult")
187-
184+
![Custom HTML table email result](./Media/flow-usage/flow-customhtmltableresult.png "Custom HTML table email result")

0 commit comments

Comments
 (0)