Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 92d7d5c

Browse files
committedJan 3, 2019
update quickstarts
1 parent 995fd98 commit 92d7d5c

File tree

11 files changed

+164
-97
lines changed

11 files changed

+164
-97
lines changed
 
Loading
Loading
Loading

‎articles/stream-analytics/stream-analytics-quick-create-powershell.md

Lines changed: 102 additions & 58 deletions
Large diffs are not rendered by default.

‎articles/stream-analytics/stream-analytics-quick-create-vs.md

Lines changed: 62 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
2-
title: Create a Stream Analytics job by using the Azure Stream Analytics tools for Visual Studio | Microsoft Docs
2+
title: Create a Stream Analytics job by using the Azure Stream Analytics tools for Visual Studio
33
description: This quickstart shows you how to get started by creating a Stream Analytics job, configuring inputs, outputs, and defining a query with Visual Studio.
44
services: stream-analytics
55
author: mamccrea
66
ms.author: mamccrea
7-
ms.date: 06/15/2018
7+
ms.date: 12/20/2018
88
ms.topic: quickstart
99
ms.service: stream-analytics
1010
ms.custom: mvc
11-
manager: kfile
1211
#Customer intent: "As an IT admin/developer I want to create a Stream Analytics job, configure input and output & analyze data by using Visual Studio."
1312
---
1413

1514
# Quickstart: Create a Stream Analytics job by using the Azure Stream Analytics tools for Visual Studio
1615

17-
This quickstart shows you how to create and run a Stream Analytics job using Azure Stream Analytics tools for Visual Studio. The example job reads streaming data from Azure blob storage. The input data file used in this quickstart contains static data for illustrative purposes only. In a real world scenario, you use streaming input data for a Stream Analytics job. In this quickstart, you define a job that calculates the average temperature when over 100° and writes the resulting output events to a new file.
16+
This quickstart shows you how to create and run a Stream Analytics job using Azure Stream Analytics tools for Visual Studio. The example job reads streaming data from an IoT Hub device. You define a job that calculates the average temperature when over 27° and writes the resulting output events to a new file in blob storage.
1817

1918
## Before you begin
2019

@@ -28,33 +27,54 @@ This quickstart shows you how to create and run a Stream Analytics job using Azu
2827

2928
## Prepare the input data
3029

31-
Before defining the Stream Analytics job, you should prepare the data, which is configured as input to the job. To prepare the input data required by the job, run the following steps:
30+
Before defining the Stream Analytics job, you should prepare the data, which is later configured as the job input. To prepare the input data required by the job, complete the following steps:
3231

33-
1. Download the [sample sensor data](https://raw.githubusercontent.com/Azure/azure-stream-analytics/master/Samples/GettingStarted/HelloWorldASA-InputStream.json) from GitHub. The sample data contains sensor information in the following JSON format:
32+
1. Sign in to the [Azure portal](https://portal.azure.com/).
3433

35-
```json
36-
{
37-
"time": "2018-01-26T21:18:52.0000000",
38-
"dspl": "sensorC",
39-
"temp": 87,
40-
"hmdt": 44
41-
}
42-
```
43-
2. Sign in to the [Azure portal](https://portal.azure.com/).
34+
2. Select **Create a resource** > **Internet of Things** > **IoT Hub**.
35+
36+
3. In the **IoT Hub** pane, enter the following information:
37+
38+
|**Setting** |**Suggested value** |**Description** |
39+
|---------|---------|---------|
40+
|Subscription | \<Your subscription\> | Select the Azure subscription that you want to use. |
41+
|Resource group | asaquickstart-resourcegroup | Select **Create New** and enter a new resource-group name for your account. |
42+
|Region | \<Select the region that is closest to your users\> | Select a geographic location where you can host your IoT Hub. Use the location that's closest to your users. |
43+
|IoT Hub Name | MyASAIoTHub | Select a name for your IoT Hub. |
44+
45+
![Create an IoT Hub](./media/stream-analytics-quick-create-vs/create-iot-hub.png)
46+
47+
4. Select **Next: Set size and scale**.
48+
49+
5. Choose your **Pricing and scale tier**. For this quickstart, select the **F1 - Free** tier if it's still available on your subscription. If the free tier is unavailable, choose the lowest tier available. For more information, see [IoT Hub pricing](https://azure.microsoft.com/pricing/details/iot-hub/).
50+
51+
![Size and scale your IoT Hub](./media/stream-analytics-quick-create-vs/iot-hub-size-and-scale.png)
52+
53+
6. Select **Review + create**. Review your IoT Hub information and click **Create**. Your IoT Hub might take a few minutes to create. You can monitor the progress in the **Notifications** pane.
54+
55+
7. In your IoT Hub navigation menu, click **Add** under **IoT devices**. Add a **Device ID** and click **Save**.
56+
57+
![Add a device to your IoT Hub](./media/stream-analytics-quick-create-vs/add-device-iot-hub.png)
4458

45-
3. From the upper left-hand corner of the Azure portal, select **Create a resource** > **Storage** > **Storage account**. Fill out the Storage account job page with **Name** set to "asaquickstartstorage", **Location** set to "West US", **Resource group** set to "asaquickstart-resourcegroup" (host the storage account in the same resource group as the Streaming job for increased performance). The remaining settings can be left to their default values.
59+
8. Once the device is created, open the device from the **IoT devices** list. Copy the **Connection string -- primary key** and save it to a notepad to use later.
4660

47-
![Create storage account](./media/stream-analytics-quick-create-vs/create-a-storage-account-vs.png)
61+
![Copy IoT Hub device connection string](./media/stream-analytics-quick-create-vs/save-iot-device-connection-string.png)
4862

49-
4. From **All resources** page, find the storage account you created in the previous step. Open the **Overview** page, and then the **Blobs** tile.
63+
## Create blob storage
5064

51-
5. From the **Blob Service** page, select **Container**, provide a **Name** for your container, such as *container1* > select **OK**.
65+
1. From the upper left-hand corner of the Azure portal, select **Create a resource** > **Storage** > **Storage account**.
5266

53-
![Create a container](./media/stream-analytics-quick-create-vs/create-a-storage-container.png)
67+
2. In the **Create storage account** pane, enter a storage account name, location, and resource group. Choose the same location and resource group as the IoT Hub you created. Then click **Review + create** to create the account.
5468

55-
6. Go to the container you created in the previous step. Select **Upload** and upload the sensor data that you got from the first step.
69+
![Create storage account](./media/stream-analytics-quick-create-portal/create-storage-account.png)
5670

57-
![Upload sample data to blob](./media/stream-analytics-quick-create-vs/upload-sample-data-to-blob.png)
71+
3. Once your storage account is created, select the **Blobs** tile on the **Overview** pane.
72+
73+
![Storage account overview](./media/stream-analytics-quick-create-portal/blob-storage.png)
74+
75+
4. From the **Blob Service** page, select **Container** and provide a name for your container, such as *container1*. Leave the **Public access level** as **Private (no anonymous access)** and select **OK**.
76+
77+
![Create blob container](./media/stream-analytics-quick-create-portal/create-blob-container.png)
5878

5979
## Create a Stream Analytics project
6080

@@ -89,11 +109,10 @@ Notice the elements that are included in an Azure Stream Analytics project.
89109
|---------|---------|---------|
90110
|Input Alias | Input | Enter a name to identify the job’s input. |
91111
|Source Type | Data Stream | Choose the appropriate input source: Data Stream or Reference Data. |
92-
|Source | Blob Storage | Choose the appropriate input source. |
112+
|Source | IoT Hub | Choose the appropriate input source. |
93113
|Resource | Choose data source from current account | Choose to enter data manually or select an existing account. |
94-
|Subscription | \<Your subscription\> | Select the Azure subscription that has the storage account you created. The storage account can be in the same or in a different subscription. This example assumes that you have created storage account in the same subscription. |
95-
|Storage Account | asaquickstartstorage | Choose or enter the name of the storage account. Storage account names are automatically detected if they are created in the same subscription. |
96-
|Container | container1 | Select the existing container that you created in your storage account. |
114+
|Subscription | \<Your subscription\> | Select the Azure subscription that has the IoT Hub you created. |
115+
|IoT Hub | MyASAIoTHub | Choose or enter the name of your IoT Hub. IoT Hub names are automatically detected if they are created in the same subscription. |
97116

98117
3. Leave other options to default values and select **Save** to save the settings.
99118

@@ -126,16 +145,10 @@ Notice the elements that are included in an Azure Stream Analytics project.
126145
2. Add the following query:
127146

128147
```sql
129-
SELECT
130-
System.Timestamp AS OutputTime,
131-
dspl AS SensorName,
132-
Avg(temp) AS AvgTemperature
133-
INTO
134-
Output
135-
FROM
136-
Input TIMESTAMP BY time
137-
GROUP BY TumblingWindow(second,30),dspl
138-
HAVING Avg(temp)>100
148+
SELECT *
149+
INTO BlobOutput
150+
FROM IoTHubInput
151+
HAVING Temperature > 27
139152
```
140153

141154
## Submit a Stream Analytics query to Azure
@@ -146,13 +159,23 @@ Notice the elements that are included in an Azure Stream Analytics project.
146159

147160
![Submit job to Azure](./media/stream-analytics-quick-create-vs/stream-analytics-job-to-azure.png)
148161

162+
## Run the IoT simulator
163+
164+
1. Open the [Raspberry Pi Azure IoT Online Simulator](https://azure-samples.github.io/raspberry-pi-web-simulator/) in a new browser tab or window.
165+
166+
2. Replace the placeholder in Line 15 with the Azure IoT Hub device connection string you saved in a previous section.
167+
168+
3. Click **Run**. The output should show the sensor data and messages that are being sent to your IoT Hub.
169+
170+
![Raspberry Pi Azure IoT Online Simulator](./media/stream-analytics-quick-create-portal/ras-pi-connection-string.png)
171+
149172
## Start the Stream Analytics job and check output
150173

151174
1. When your job is created, the job view opens automatically. Select the green arrow button to start the job,
152175

153176
![Start Stream Analytics job](./media/stream-analytics-quick-create-vs/start-stream-analytics-job-vs.png)
154177

155-
2. Change the date **Custom Time** to `2018-01-01` and select **Start**.
178+
2. Change the **Job output start mode** to **JobStartTime** and select **Start**.
156179

157180
![Start job configuration](./media/stream-analytics-quick-create-vs/stream-analytics-start-configuration.png)
158181

@@ -176,7 +199,7 @@ When no longer needed, delete the resource group, the streaming job, and all rel
176199

177200
In this quickstart, you deployed a simple Stream Analytics job using Visual Studio. You can also deploy Stream Analytics jobs using the [Azure portal](stream-analytics-quick-create-portal.md) and [PowerShell](stream-analytics-quick-create-powershell.md).
178201

179-
To learn about configuring other input sources and performing real-time detection, continue to the following article:
202+
To learn about Azure Stream Analytics tools for Visual Studio, continue to the following article:
180203

181204
> [!div class="nextstepaction"]
182-
> [Real-time fraud detection using Azure Stream Analytics](stream-analytics-real-time-fraud-detection.md)
205+
> [Use Visual Studio to view Azure Stream Analytics jobs](stream-analytics-vs-tools.md)

0 commit comments

Comments
 (0)
Please sign in to comment.