You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
17
17
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:
25
19
> [!div class="checklist"]
26
20
>
27
21
> * Create an Azure Stream Analytics job to process data on the edge.
@@ -30,11 +24,19 @@ In this tutorial, you learn how to:
30
24
31
25
:::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.":::
32
26
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).
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).
40
42
@@ -100,33 +102,37 @@ This section creates a job that receives temperature data from an IoT Edge devic
100
102
> [!NOTE]
101
103
> 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.
102
104
105
+
#### Set your input and output
106
+
103
107
1. Navigate to your Stream Analytics job in the Azure portal.
104
108
105
109
1. Under **Job topology**, select **Inputs** then **Add input**.
:::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.":::
108
112
109
113
1. Choose **Edge Hub** from the drop-down list.
110
114
111
115
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.
112
116
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**.
114
118
115
119
1. Keep the default values for the other fields, and select **Save**.
116
120
117
121
1. Under **Job Topology**, open **Outputs** then select **Add**.
:::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.":::
120
124
121
125
1. Choose **Edge Hub** from the drop-down list.
122
126
123
127
1. In the **New output** pane, enter **alert** as the output alias.
124
128
125
129
1. Keep the default values for the other fields, and select **Save**.
126
130
131
+
#### Create a query
132
+
127
133
1. Under **Job Topology**, select **Query**.
128
134
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.
130
136
131
137
```sql
132
138
SELECT
@@ -139,6 +145,8 @@ This section creates a job that receives temperature data from an IoT Edge devic
139
145
HAVINGAvg(machine.temperature) >70
140
146
```
141
147
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.
0 commit comments