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-udf.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: bertvanhoof
8
8
ms.custom: seodec18
9
9
ms.service: digital-twins
10
10
ms.topic: tutorial
11
-
ms.date: 11/13/2019
11
+
ms.date: 01/10/2020
12
12
#Customer intent: As an Azure IoT developer, I want to walk through a sample application to monitor a space using Azure Digital Twins.
13
13
---
14
14
@@ -34,7 +34,7 @@ This tutorial assumes that you have [finished your Azure Digital Twins setup](tu
34
34
-[.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.
35
35
-[Visual Studio Code](https://code.visualstudio.com/) to explore the sample code.
36
36
37
-
>[!TIP]
37
+
>[!TIP]
38
38
> Use a unique Digital Twins instance name if you're provisioning a new instance.
39
39
40
40
## Define conditions to monitor
@@ -70,7 +70,7 @@ Also note the section named **roleassignments**. It assigns the Space Administra
70
70
71
71
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.
72
72
73
-
>[!NOTE]
73
+
>[!NOTE]
74
74
> This section modifies the file *src\actions\userDefinedFunctions\availability.js* so you can learn in detail one way to write a user-defined function. However, you can choose to directly use the file [src\actions\userDefinedFunctions\availabilityForTutorial.js](https://github.com/Azure-Samples/digital-twins-samples-csharp/blob/master/occupancy-quickstart/src/actions/userDefinedFunctions/availabilityForTutorial.js) in your setup. This file has all the changes required for this tutorial. If you use this file instead, make sure to use the correct file name for the **script** key in [src\actions\provisionSample.yaml](https://github.com/Azure-Samples/digital-twins-samples-csharp/blob/master/occupancy-quickstart/src/actions/provisionSample.yaml).
75
75
76
76
a. At the top of the file, add the following lines for temperature below the comment `// Add your sensor type here`:
@@ -174,7 +174,7 @@ Also note the section named **roleassignments**. It assigns the Space Administra
174
174
dotnet run ProvisionSample
175
175
```
176
176
177
-
>[!IMPORTANT]
177
+
>[!IMPORTANT]
178
178
> 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
179
180
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`.
@@ -183,7 +183,7 @@ Also note the section named **roleassignments**. It assigns the Space Administra
> 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
188
189
189
## Simulate sensor data
@@ -225,7 +225,7 @@ In this section, you'll use the project named *device-connectivity* in the sampl
225
225
dotnet run
226
226
```
227
227
228
-
>[!NOTE]
228
+
>[!NOTE]
229
229
> Because the simulation sample does not directly communicate with your Digital Twins instance, it does not require you to authenticate.
230
230
231
231
## Get results of the user-defined function
@@ -242,7 +242,7 @@ The user-defined function runs every time your instance receives device and sens
242
242
243
243
The output window shows how the user-defined function runs and intercepts events from the device simulation.
244
244
245
-
[](./media/tutorial-facilities-udf/udf-running.png#lightbox)
245
+
[](./media/tutorial-facilities-udf/adt-tutorial-udf-running.png#lightbox)
246
246
247
247
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.
248
248
@@ -252,7 +252,7 @@ If you want to stop exploring Azure Digital Twins at this point, feel free to de
252
252
253
253
1. From the left menu in the [Azure portal](https://portal.azure.com), select **All resources**, select your Digital Twins resource group, and select **Delete**.
254
254
255
-
>[!TIP]
255
+
>[!TIP]
256
256
> If you experienced trouble deleting your Digital Twins instance, a service update has been rolled out with the fix. Please retry deleting your instance.
257
257
258
258
2. If necessary, delete the sample applications on your work machine.
0 commit comments