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
Copy file name to clipboardExpand all lines: articles/digital-twins/tutorial-facilities-analyze.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,9 @@ author: alinamstanciu
6
6
ms.custom: seodec18
7
7
ms.service: digital-twins
8
8
ms.topic: tutorial
9
-
ms.date: 08/05/2019
9
+
ms.date: 09/23/2019
10
10
ms.author: alinast
11
+
#Customer intent: As an Azure IoT developer, I want to walk through a sample application to learn how to analyze events from an Azure Digital Twins instance.
11
12
---
12
13
13
14
# Tutorial: Visualize and analyze events from your Azure Digital Twins spaces by using Time Series Insights
@@ -33,6 +34,9 @@ This tutorial assumes that you have [configured](tutorial-facilities-setup.md) a
33
34
- The [Digital Twins C# samples](https://github.com/Azure-Samples/digital-twins-samples-csharp) downloaded and extracted on your work machine.
34
35
-[.NET Core SDK version 2.1.403 or later](https://www.microsoft.com/net/download) on your development machine to run the sample. Run `dotnet --version` to verify that the right version is installed.
35
36
37
+
> [!TIP]
38
+
> Use a unique Digital Twins instance name if you're provisioning a new instance.
39
+
36
40
## Stream data by using Event Hubs
37
41
38
42
You can use the [Event Hubs](../event-hubs/event-hubs-about.md) service to create a pipeline to stream your data. This section shows you how to create your event hub as the connector between your Azure Digital Twins and Time Series Insights instances.
@@ -125,7 +129,7 @@ You can use the [Event Hubs](../event-hubs/event-hubs-about.md) service to creat
125
129
126
130
1. In the left pane of the [Azure portal](https://portal.azure.com), select **Create a resource**.
127
131
128
-
1. Search for and select a new **Time Series Insights** resource. Select **Create**.
132
+
1. Search for and select a **Time Series Insights** General Availability (GA) resource. Select **Create**.
129
133
130
134
1. Enter a **Name** for your Time Series Insights instance, and then select your **Subscription**. Select the **Resource group** that you used for your Digital Twins instance, and your **Location**. Select **Next: Event Source** button or the **Event Source** tab.
Copy file name to clipboardExpand all lines: articles/digital-twins/tutorial-facilities-events.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,9 @@ author: alinamstanciu
6
6
ms.custom: seodec18
7
7
ms.service: digital-twins
8
8
ms.topic: tutorial
9
-
ms.date: 08/05/2019
9
+
ms.date: 09/23/2019
10
10
ms.author: alinast
11
+
#Customer intent: As an Azure IoT developer, I want to walk through a sample application to learn how to capture events from a Azure Digital Twins space.
11
12
---
12
13
13
14
# Tutorial: Receive notifications from your Azure Digital Twins spaces by using Logic Apps
@@ -34,6 +35,9 @@ This tutorial assumes that you have [configured](tutorial-facilities-setup.md) a
34
35
-[.NET Core SDK version 2.1.403 or later](https://www.microsoft.com/net/download) on your development machine to run the sample. Run `dotnet --version` to verify that the right version is installed.
35
36
- An Office 365 account to send notification e-mails.
36
37
38
+
> [!TIP]
39
+
> Use a unique Digital Twins instance name if you're provisioning a new instance.
40
+
37
41
## Integrate events with Event Grid
38
42
39
43
In this section, you set up [Event Grid](../event-grid/overview.md) to collect events from your Azure Digital Twins instance, and redirect them to an [event handler](../event-grid/event-handlers.md) such as Logic Apps.
Copy file name to clipboardExpand all lines: articles/digital-twins/tutorial-facilities-setup.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ In the extracted sample folder, open the file **digital-twins-samples-csharp\dig
76
76
- The **getAvailableAndFreshSpaces.cs** file gets the results of a custom function called a user-defined function.
77
77
- The **createEndpoints.cs** file creates endpoints to interact with other services.
78
78
79
-
* The simulation sample **device-connectivity** simulates sensor data and sends it to the IoT hub that's provisioned for your Digital Twins instance. You'll use this sample in [the next tutorial after you provision your spatial graph](tutorial-facilities-udf.md#simulate). The sensor and device identifiers that you use to configure this sample should be the same as what you'll use to provision your graph.
79
+
* The simulation sample **device-connectivity** simulates sensor data and sends it to the IoT hub that's provisioned for your Digital Twins instance. You'll use this sample in [the next tutorial after you provision your spatial graph](tutorial-facilities-udf.md#simulate-sensor-data). The sensor and device identifiers that you use to configure this sample should be the same as what you'll use to provision your graph.
Copy file name to clipboardExpand all lines: articles/digital-twins/tutorial-facilities-udf.md
+14-17Lines changed: 14 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,9 @@ author: alinamstanciu
6
6
ms.custom: seodec18
7
7
ms.service: digital-twins
8
8
ms.topic: tutorial
9
-
ms.date: 08/16/2019
9
+
ms.date: 09/20/2019
10
10
ms.author: alinast
11
+
#Customer intent: As an Azure IoT developer, I want to walk through a sample application to monitor a space using Azure Digital Twins.
11
12
---
12
13
13
14
# Tutorial: Provision your building and monitor working conditions with Azure Digital Twins Preview
@@ -32,6 +33,9 @@ This tutorial assumes that you have [finished your Azure Digital Twins setup](tu
32
33
-[.NET Core SDK version 2.1.403 or later](https://www.microsoft.com/net/download) on your development machine to build and run the sample. Run `dotnet --version` to verify that the right version is installed.
33
34
-[Visual Studio Code](https://code.visualstudio.com/) to explore the sample code.
34
35
36
+
> [!TIP]
37
+
> Use a unique Digital Twins instance name if you're provisioning a new instance.
38
+
35
39
## Define conditions to monitor
36
40
37
41
You can define a set of specific conditions to monitor in the device or sensor data, called *matchers*. You can then define functions called *user-defined functions*. User-defined functions execute custom logic on data that comes from your spaces and devices, when the conditions specified by the matchers occur. For more information, read [Data processing and user-defined functions](concepts-user-defined-functions.md).
@@ -45,25 +49,23 @@ Add the following matcher below the existing matchers. Make sure the keys are al
45
49
dataTypeValue: Temperature
46
50
```
47
51
48
-
This matcher will track the SAMPLE_SENSOR_TEMPERATURE sensor that you added in [the first tutorial](tutorial-facilities-setup.md).
49
-
50
-
<a id="udf"></a>
52
+
This matcher will track the `SAMPLE_SENSOR_TEMPERATURE` sensor that you added in [the first tutorial](tutorial-facilities-setup.md).
51
53
52
54
## Create a user-defined function
53
55
54
56
You can use user-defined functions to customize the processing of your sensor data. They're custom JavaScript code that can run within your Azure Digital Twins instance, when specific conditions as described by the matchers occur. You can create matchers and user-defined functions for each sensor that you want to monitor. For more information, read [Data processing and user-defined functions](concepts-user-defined-functions.md).
55
57
56
-
In the sample provisionSample.yaml file, look for a section that begins with the type **userdefinedfunctions**. This section provisions a user-defined function with a given **Name**. This UDF acts on the list of matchers under **matcherNames**. Notice how you can provide your own JavaScript file for the UDF as the **script**.
58
+
In the sample *provisionSample.yaml* file, look for a section that begins with the type **userdefinedfunctions**. This section provisions a user-defined function with a given **Name**. This UDF acts on the list of matchers under **matcherNames**. Notice how you can provide your own JavaScript file for the UDF as the **script**.
57
59
58
60
Also note the section named **roleassignments**. It assigns the Space Administrator role to the user-defined function. This role allows it to access the events that come from any of the provisioned spaces.
59
61
60
-
1. Configure the UDF to include the temperature matcher by adding or uncommenting the following line in the `matcherNames` node of the provisionSample.yaml file:
62
+
1. Configure the UDF to include the temperature matcher by adding or uncommenting the following line in the `matcherNames` node of the *provisionSample.yaml* file:
61
63
62
64
```yaml
63
65
- Matcher Temperature
64
66
```
65
67
66
-
1. Open the file **src\actions\userDefinedFunctions\availability.js** in your editor. This is the file referenced in the **script** element of provisionSample.yaml. The user-defined function in this file looks for conditions when no motion is detected in the room and carbon dioxide levels are below 1,000 ppm.
68
+
1. Open the file **src\actions\userDefinedFunctions\availability.js** in your editor. This is the file referenced in the **script** element of *provisionSample.yaml*. The user-defined function in this file looks for conditions when no motion is detected in the room and carbon dioxide levels are below 1,000 ppm.
67
69
68
70
Modify the JavaScript file to monitor temperature and other conditions. Add the following lines of code to look for conditions when no motion is detected in the room, carbon dioxide levels are below 1,000 ppm, and temperature is below 78 degrees Fahrenheit.
69
71
@@ -130,15 +132,12 @@ Also note the section named **roleassignments**. It assigns the Space Administra
@@ -177,7 +176,7 @@ Also note the section named **roleassignments**. It assigns the Space Administra
177
176
> [!IMPORTANT]
178
177
> To prevent unauthorized access to your Digital Twins Management API, the **occupancy-quickstart** application requires you to sign in with your Azure account credentials. It saves your credentials for a brief period, so you might not need to sign in every time you run it. The first time this program runs, and when your saved credentials expire after that, the application directs you to a sign-in page and gives a session-specific code to enter on that page. Follow the prompts to sign in with your Azure account.
179
178
180
-
1. After your account is authenticated, the application starts creating a sample spatial graph as configured in provisionSample.yaml. Wait until the provisioning finishes. It will take a few minutes. After that, observe the messages in the command window and notice how your spatial graph is created. Notice how the application creates an IoT hub at the root node or the `Venue`.
179
+
1. After your account is authenticated, the application starts creating a sample spatial graph as configured in *provisionSample.yaml*. Wait until the provisioning finishes. It will take a few minutes. After that, observe the messages in the command window and notice how your spatial graph is created. Notice how the application creates an IoT hub at the root node or the `Venue`.
181
180
182
181
1. From the output in the command window, copy the value of `ConnectionString`, under the `Devices` section, to your clipboard. You'll need this value to simulate the device connection in the next section.
183
182
@@ -186,8 +185,6 @@ Also note the section named **roleassignments**. It assigns the Space Administra
186
185
> [!TIP]
187
186
> If you get an error message similar to "The I/O operation has been aborted because of either a thread exit or an application request" in the middle of the provisioning, try running the command again. This might happen if the HTTP client timed out from a network issue.
188
187
189
-
<a id="simulate"></a>
190
-
191
188
## Simulate sensor data
192
189
193
190
In this section, you'll use the project named *device-connectivity* in the sample. You'll simulate sensor data for detecting motion, temperature, and carbon dioxide. This project generates random values for the sensors, and sends them to the IoT hub by using the device connection string.
@@ -204,9 +201,9 @@ In this section, you'll use the project named *device-connectivity* in the sampl
204
201
205
202
a. **DeviceConnectionString**: Assign the value of `ConnectionString` in the output window from the previous section. Copy this string completely, within the quotes, so the simulator can connect properly with the IoT hub.
206
203
207
-
b. **HardwareId** within the **Sensors** array: Because you're simulating events from sensors provisioned to your Azure Digital Twins instance, the hardware ID and the names of the sensors in this file should match the `sensors` node of the provisionSample.yaml file.
204
+
b. **HardwareId** within the **Sensors** array: Because you're simulating events from sensors provisioned to your Azure Digital Twins instance, the hardware ID and the names of the sensors in this file should match the `sensors` node of the *provisionSample.yaml* file.
208
205
209
-
Add a new entry for the temperature sensor. The **Sensors** node in appsettings.json should look like the following:
206
+
Add a new entry for the temperature sensor. The **Sensors** node in *appsettings.json* should look like the following:
210
207
211
208
```JSON
212
209
"Sensors": [{
@@ -246,7 +243,7 @@ The output window shows how the user-defined function runs and intercepts events
246
243
247
244

248
245
249
-
If the monitored condition is met, the user-defined function sets the value of the space with the relevant message, as we saw [earlier](#udf). The `GetAvailableAndFreshSpaces` function prints out the message on the console.
246
+
If the monitored condition is met, the user-defined function sets the value of the space with the relevant message, as we saw [earlier](#create-a-user-defined-function). The `GetAvailableAndFreshSpaces` function prints out the message on the console.
0 commit comments