Skip to content

Commit 74cc637

Browse files
committed
Added screenshots and edits
1 parent 13a6f1a commit 74cc637

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed
48.4 KB
Loading
45.8 KB
Loading
Binary file not shown.
Binary file not shown.

articles/iot-edge/tutorial-deploy-stream-analytics.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 'Tutorial - Stream Analytics at the edge using Azure IoT Edge'
3-
description: 'In this tutorial, you deploy Azure Stream Analytics as a module to an IoT Edge device'
2+
title: 'Tutorial - Deploy Azure Stream Analytics as an IoT Edge module'
3+
description: 'In this tutorial, you deploy Azure Stream Analytics as a module to an IoT Edge device.'
44
author: PatAltimore
55
ms.author: patricka
66
ms.date: 3/8/2023
@@ -13,15 +13,9 @@ ms.custom: mvc
1313

1414
[!INCLUDE [iot-edge-version-all-supported](includes/iot-edge-version-all-supported.md)]
1515

16-
Many IoT solutions use analytics services to gain insight about data as it arrives in the cloud from IoT devices. With Azure IoT Edge, you can take [Azure Stream Analytics](../stream-analytics/index.yml) logic and move it onto the device itself. By processing telemetry streams at the edge, you can reduce the amount of uploaded data and reduce the time it takes to react to actionable insights.
16+
In this tutorial, you create an Azure Stream Analytics job in the Azure portal and then deploy it as an IoT Edge module with no additional code.
1717

18-
Azure IoT Edge and Azure Stream Analytics are integrated to simplify your workload development. You can create an Azure Stream Analytics job in the Azure portal and then deploy it as an IoT Edge module with no additional code.
19-
20-
Azure Stream Analytics provides a richly structured query syntax for data analysis, both in the cloud and on IoT Edge devices. For more information, see [Azure Stream Analytics documentation](../stream-analytics/stream-analytics-edge.md).
21-
22-
The Stream Analytics module in this tutorial calculates the average temperature over a rolling 30-second window. When that average reaches 70, the module sends an alert for the device to take action. In this case, that action is to reset the simulated temperature sensor. In a production environment, you might use this functionality to shut off a machine or take preventative measures when the temperature reaches dangerous levels.
23-
24-
In this tutorial, you learn how to:
18+
You learn how to:
2519
> [!div class="checklist"]
2620
>
2721
> * Create an Azure Stream Analytics job to process data on the edge.
@@ -30,11 +24,19 @@ In this tutorial, you learn how to:
3024
3125
:::image type="content" source="./media/tutorial-deploy-stream-analytics/asa-architecture.png" alt-text="Diagram of stream architecture, showing the staging and deploying of an Azure Stream Analytics job.":::
3226

27+
The Stream Analytics module in this tutorial calculates the average temperature over a rolling 30-second window. When that average reaches 70, the module sends an alert for the device to take action. In this case, that action is to reset the simulated temperature sensor. In a production environment, you might use this functionality to shut off a machine or take preventative measures when the temperature reaches dangerous levels.
28+
29+
## Why use Azure Stream Analytics in IoT Edge?
30+
31+
Many IoT solutions use analytics services to gain insight about data as it arrives in the cloud from IoT devices. With Azure IoT Edge, you can take [Azure Stream Analytics](../stream-analytics/index.yml) logic and move it onto the device itself. By processing telemetry streams at the edge, you can reduce the amount of uploaded data and reduce the time it takes to react to actionable insights. Azure IoT Edge and Azure Stream Analytics are integrated to simplify your workload development.
32+
33+
Azure Stream Analytics provides a richly structured query syntax for data analysis, both in the cloud and on IoT Edge devices. For more information, see [Azure Stream Analytics documentation](../stream-analytics/stream-analytics-edge.md).
34+
3335
## Prerequisites
3436

3537
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
3638

37-
* An Azure IoT Edge device
39+
* An Azure IoT Edge device.
3840

3941
You can use an Azure virtual machine as an IoT Edge device by following the steps in the quickstart for [Linux](quickstart-linux.md) or [Windows devices](quickstart.md).
4042

@@ -100,33 +102,37 @@ This section creates a job that receives temperature data from an IoT Edge devic
100102
> [!NOTE]
101103
> You specify exactly where the data comes from and goes to in the next section, [Configure IoT Edge settings](#configure-iot-edge-settings), when you deploy the job.
102104
105+
#### Set your input and output
106+
103107
1. Navigate to your Stream Analytics job in the Azure portal.
104108

105109
1. Under **Job topology**, select **Inputs** then **Add input**.
106110

107-
![Azure Stream Analytics - add input](./media/tutorial-deploy-stream-analytics/asa-input.png)
111+
:::image type="content" source="./media/tutorial-deploy-stream-analytics/add-input.png" alt-text="Screenshot showing where to add stream input in the Azure portal.":::
108112

109113
1. Choose **Edge Hub** from the drop-down list.
110114

111115
If you don't see the **Edge Hub** option in the list, then you may have created your Stream Analytics job as a cloud-hosted job. Try creating a new job and be sure to select **Edge** as the hosting environment.
112116

113-
1. In the **New input** pane, enter **temperature** as the input alias.
117+
1. In the **New input** pane, enter **temperature** as the **Input alias**.
114118

115119
1. Keep the default values for the other fields, and select **Save**.
116120

117121
1. Under **Job Topology**, open **Outputs** then select **Add**.
118122

119-
![Azure Stream Analytics - add output](./media/tutorial-deploy-stream-analytics/asa-output.png)
123+
:::image type="content" source="./media/tutorial-deploy-stream-analytics/add-output.png" alt-text="Screenshot showing where to add stream output in the Azure portal.":::
120124

121125
1. Choose **Edge Hub** from the drop-down list.
122126

123127
1. In the **New output** pane, enter **alert** as the output alias.
124128

125129
1. Keep the default values for the other fields, and select **Save**.
126130

131+
#### Create a query
132+
127133
1. Under **Job Topology**, select **Query**.
128134

129-
1. Replace the default text with the following query. The SQL code sends a reset command to the alert output if the average machine temperature in a 30-second window reaches 70 degrees. The reset command has been pre-programmed into the sensor as an action that can be taken.
135+
1. Replace the default text with the following query.
130136

131137
```sql
132138
SELECT
@@ -139,6 +145,8 @@ This section creates a job that receives temperature data from an IoT Edge devic
139145
HAVING Avg(machine.temperature) > 70
140146
```
141147

148+
In this query, the SQL code sends a reset command to the alert output if the average machine temperature in a 30-second window reaches 70 degrees. The reset command has been pre-programmed into the sensor as an action that can be taken.
149+
142150
1. Select **Save query**.
143151

144152
### Configure IoT Edge settings

0 commit comments

Comments
 (0)