Skip to content

Commit b940ab4

Browse files
committed
Process IoT Streaming data - Freshness
1 parent 9ac8f83 commit b940ab4

1 file changed

Lines changed: 27 additions & 25 deletions

File tree

articles/stream-analytics/stream-analytics-get-started-with-azure-stream-analytics-to-process-data-from-iot-devices.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
title: Process real-time IoT data streams
2+
title: Real-Time IoT Data Processing With Azure Stream Analytics
33
description: Shows you how to create stream processing logic to gather data from Internet of Things (IoT) devices. It uses a real-world IoT use case to demonstrate.
4-
author: AliciaLiMicrosoft
5-
ms.author: ali
4+
#customer intent: As a data engineer, I want to process real-time IoT data streams using Azure Stream Analytics so that I can gain actionable insights from sensor data.
5+
author: AliciaLiMicrosoft
6+
ms.author: ali
7+
ms.reviewer: spelluru
68
ms.service: azure-stream-analytics
79
ms.topic: how-to
8-
ms.date: 01/23/2025
10+
ms.date: 03/26/2026
911
# Customer intent: I want to learn how to process real-time IoT data streams with Azure Stream Analytics.
1012
---
1113
# Process real-time IoT data streams with Azure Stream Analytics
@@ -19,9 +21,9 @@ In this article, you learn how to create stream-processing logic to gather data
1921

2022
## Scenario
2123

22-
Contoso, a company in the industrial automation space, has automated its manufacturing process. The machinery in this plant has sensors that are capable of emitting streams of data in real time. In this scenario, a production floor manager wants to have real-time insights from the sensor data to look for patterns and take actions on them. You can use Stream Analytics Query Language (SAQL) over the sensor data to find interesting patterns from the incoming stream of data.
24+
Contoso, a company in the industrial automation space, automated its manufacturing process. The machinery in this plant has sensors that emit streams of data in real time. In this scenario, a production floor manager wants to have real-time insights from the sensor data to look for patterns and take actions on them. You can use Stream Analytics Query Language (SAQL) over the sensor data to find interesting patterns from the incoming stream of data.
2325

24-
In this example, the data is generated from a Texas Instruments sensor tag device. The payload of the data is in JSON format as shown in the following sample snippet:
26+
In this example, the data comes from a Texas Instruments sensor tag device. The payload of the data is in JSON format as shown in the following sample snippet:
2527

2628
```json
2729
{
@@ -38,23 +40,23 @@ For ease of use, this getting started guide provides a sample data file, which w
3840

3941
## Create a Stream Analytics job
4042

41-
1. Navigate to the [Azure portal](https://portal.azure.com).
42-
1. On the left navigation menu, select **All services**, select **Analytics**, hover the mouse over **Stream Analytics jobs**, and then select **Create**.
43+
1. Go to the [Azure portal](https://portal.azure.com).
44+
1. On the left navigation menu, select **All services**. Under **Analytics**, select **Stream Analytics jobs**, and then select **Create**.
4345

4446
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-02.png" alt-text="Screenshot that shows the selection of Create button for a Stream Analytics job." lightbox="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-02.png":::
45-
1. On the **New Stream Analytics job** page, follow these steps:
47+
1. On **New Stream Analytics job**, follow these steps:
4648
1. For **Subscription**, select your **Azure subscription**.
47-
1. For **Resource group**, select an existing resource group or create a resource group.
49+
1. For **Resource group**, select an existing resource group or create a new one.
4850
1. For **Name**, enter a unique name for the Stream Analytics job.
49-
1. Select the **Region** in which you want to deploy the Stream Analytics job. Use the same location for your resource group and all resources to increase the processing speed and reduce costs.
51+
1. Select the **Region** where you want to deploy the Stream Analytics job. Use the same location for your resource group and all resources to increase the processing speed and reduce costs.
5052
1. Select **Review + create**.
5153

5254
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-03.png" alt-text="Screenshot that shows the New Stream Analytics job page.":::
53-
1. On the **Review + create** page, review settings, and select **Create**.
54-
1. After the deployment succeeds, select **Go to resource** to navigate to the **Stream Analytics job** page for your Stream Analytics job.
55+
1. On **Review + create**, review the settings, and select **Create**.
56+
1. After the deployment succeeds, select **Go to resource** to go to the **Stream Analytics job** page for your Stream Analytics job.
5557

5658
## Create an Azure Stream Analytics query
57-
After your job is created, write a query. You can test queries against sample data without connecting an input or output to your job.
59+
After you create your job, write a query. You can test queries against sample data without connecting an input or output to your job.
5860

5961
1. Download the [HelloWorldASA-InputStream.json](https://github.com/Azure/azure-stream-analytics/blob/master/Samples/GettingStarted/HelloWorldASA-InputStream.json) from GitHub.
6062
1. On the **Azure Stream Analytics job** page in the Azure portal, select **Query** under **Job topology** from the left menu.
@@ -68,26 +70,26 @@ After your job is created, write a query. You can test queries against sample da
6870
FROM
6971
yourinputalias
7072
```
71-
73+
1. Select **Save** on the command bar to save your query.
7274
1. In the bottom pane, select **Upload sample input**, select the `HelloWorldASA-InputStream.json` file you downloaded, and select **OK**.
7375

74-
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-05.png" alt-text="Screenshot that shows the **Query** page with **Upload sample input** selected." lightbox="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-05.png":::
75-
1. Notice that a preview of the data is automatically populated in the **Input preview** table.
76+
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-05.png" alt-text="Screenshot that shows the Query page with Upload sample input selected." lightbox="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-05.png":::
77+
1. A preview of the data automatically appears in the **Input preview** table.
7678

7779
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/input-preview.png" alt-text="Screenshot that shows sample input data in the Input preview tab.":::
7880

7981
### Query: Archive your raw data
8082

81-
The simplest form of query is a pass-through query that archives all input data to its designated output. This query is the default query populated in a new Azure Stream Analytics job.
83+
The simplest form of query is a pass-through query that archives all input data to its designated output. This query is the default query in a new Azure Stream Analytics job.
8284

8385
1. Select **Test query** on the toolbar.
84-
2. View the results in the **Test results** tab in the bottom pane.
86+
1. View the results in the **Test results** tab in the bottom pane.
8587

8688
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-07.png" alt-text="Screenshot that shows the sample query and its results.":::
8789

8890
### Query: Filter the data based on a condition
8991

90-
Let's update the query to filter the results based on a condition. For example, the following query shows events that come from `sensorA`."
92+
Update the query to filter the results based on a condition. For example, the following query shows events that come from `sensorA`.
9193

9294
1. Update the query with the following sample:
9395

@@ -103,7 +105,7 @@ Let's update the query to filter the results based on a condition. For example,
103105
yourinputalias
104106
WHERE dspl='sensorA'
105107
```
106-
2. Select **Test query** to see the results of the query.
108+
1. Select **Test query** to see the results of the query.
107109

108110
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-08.png" alt-text="Screenshot that shows the query results with the filter.":::
109111

@@ -129,7 +131,7 @@ Let's make our query more detailed. For every type of sensor, we want to monitor
129131
130132
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-10.png" alt-text="Screenshot that shows the query with a tumbling window.":::
131133
132-
You should see results that contain only 245 rows and names of sensors where the average temperate is greater than 100. This query groups the stream of events by **dspl**, which is the sensor name, over a **Tumbling Window** of 30 seconds. Temporal queries must state how you want time to progress. By using the **TIMESTAMP BY** clause, you have specified the **OUTPUTTIME** column to associate times with all temporal calculations. For detailed information, read about [Time Management](/stream-analytics-query/time-management-azure-stream-analytics) and [Windowing functions](/stream-analytics-query/windowing-azure-stream-analytics).
134+
You should see results that contain only 245 rows and names of sensors where the average temperate is greater than 100. This query groups the stream of events by **dspl**, which is the sensor name, over a **Tumbling Window** of 30 seconds. Temporal queries must state how you want time to progress. By using the **TIMESTAMP BY** clause, you specified the **OUTPUTTIME** column to associate times with all temporal calculations. For detailed information, read about [Time Management](/stream-analytics-query/time-management-azure-stream-analytics) and [Windowing functions](/stream-analytics-query/windowing-azure-stream-analytics).
133135
134136
### Query: Detect absence of events
135137
@@ -151,13 +153,13 @@ How can we write a query to find a lack of input events? Let's find the last tim
151153
DATEDIFF(second,t1,t2) BETWEEN 1 and 5
152154
WHERE t2.dspl IS NULL
153155
```
154-
2. Select **Test query** to see the results of the query.
156+
1. Select **Test query** to see the results of the query.
155157
156158
:::image type="content" source="./media/stream-analytics-get-started-with-iot-devices/stream-analytics-get-started-with-iot-devices-11.png" alt-text="Screenshot that shows the query that detects absence of events.":::
157159
158160
159-
Here we use a **LEFT OUTER** join to the same data stream (self-join). For an **INNER** join, a result is returned only when a match is found. For a **LEFT OUTER** join, if an event from the left side of the join is unmatched, a row that has NULL for all the columns of the right side is returned. This technique is useful to find an absence of events. For more information, see [JOIN](/stream-analytics-query/join-azure-stream-analytics).
161+
This query uses a **LEFT OUTER** join to the same data stream (self-join). For an **INNER** join, a result is returned only when a match is found. For a **LEFT OUTER** join, if an event from the left side of the join is unmatched, the query returns a row that has NULL for all the columns of the right side. This technique is useful to find an absence of events. For more information, see [JOIN](/stream-analytics-query/join-azure-stream-analytics).
160162
161163
## Conclusion
162164
163-
The purpose of this article is to demonstrate how to write different Stream Analytics Query Language queries and see results in the browser. However, this article is just to get you started. Stream Analytics supports various inputs and outputs and can even use functions in Azure Machine Learning to make it a robust tool for analyzing data streams. For more information about how to write queries, read the article about [common query patterns](stream-analytics-stream-analytics-query-patterns.md).
165+
This article demonstrates how to write different Stream Analytics Query Language queries and see results in the browser. However, this article is just to get you started. Stream Analytics supports various inputs and outputs and can even use functions in Azure Machine Learning to make it a robust tool for analyzing data streams. For more information about how to write queries, see [common query patterns](stream-analytics-stream-analytics-query-patterns.md).

0 commit comments

Comments
 (0)