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-end-to-end.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,12 @@ titleSuffix: Azure Digital Twins
4
4
description: Follow this tutorial to learn how to build out an end-to-end Azure Digital Twins solution that's driven by device data.
5
5
author: baanders
6
6
ms.author: baanders # Microsoft employees only
7
-
ms.date: 09/26/2022
7
+
ms.date: 09/12/2023
8
8
ms.topic: tutorial
9
9
ms.service: digital-twins
10
10
ms.custom: engagement-fy23, devx-track-azurecli
11
11
12
+
# CustomerIntent: As a developer, I want to create a data flow from devices through Azure Digital Twins so that I can have a connected digital twin solution.
12
13
# Optional fields. Don't forget to remove # if you need a field.
> * Use an [Azure Functions](../azure-functions/functions-overview.md) app to route simulated telemetry from an [IoT Hub](../iot-hub/about-iot-hub.md) device into digital twin properties
26
27
> * Propagate changes through the twin graph by processing digital twin notifications with Azure Functions, endpoints, and routes
27
28
28
-
[!INCLUDE [Azure Digital Twins tutorial: sample prerequisites](../../includes/digital-twins-tutorial-sample-prereqs.md)]
29
+
[!INCLUDE [Sample prerequisites for Azure Digital Twins tutorial](../../includes/digital-twins-tutorial-sample-prereqs.md)]
@@ -99,7 +100,7 @@ The function app is part of the sample project you downloaded, located in the *d
99
100
100
101
### Publish the app
101
102
102
-
To publish the function app to Azure, you'll need to create a storage account, then create the function app in Azure, and finally publish the functions to the Azure function app. This section completes these actions using the Azure CLI.
103
+
To publish the function app to Azure, you'll need to create a storage account, then create the function app in Azure, and finally publish the functions to the Azure function app. This section completes these actions using the Azure CLI. In each command, replace any placeholders in angle brackets with the details for your own resources.
103
104
104
105
1. Create an Azure storage account by running the following command:
105
106
@@ -110,7 +111,7 @@ To publish the function app to Azure, you'll need to create a storage account, t
110
111
1. Create an Azure function app by running the following command:
1. Next, you'll zip up the functions and publish them to your new Azure function app.
@@ -120,22 +121,17 @@ To publish the function app to Azure, you'll need to create a storage account, t
120
121
1. In the console, run the following command to publish the project locally:
121
122
122
123
```cmd/sh
123
-
dotnet publish -c Release
124
+
dotnet publish -c Release -o publish
124
125
```
125
126
126
-
This command publishes the project to the *digital-twins-samples-main\AdtSampleApp\SampleFunctionsApp\bin\Release\netcoreapp3.1\publish* directory.
127
+
This command publishes the project to the *digital-twins-samples-main\AdtSampleApp\SampleFunctionsApp\publish* directory.
127
128
128
-
1. Using your preferred method, create a zip of the published files that are located in the *digital-twins-samples-main\AdtSampleApp\SampleFunctionsApp\bin\Release\netcoreapp3.1\publish* directory. Name the zipped folder *publish.zip*.
129
+
1. Using your preferred method, create a zip of the published files that are located **inside** the *digital-twins-samples-main\AdtSampleApp\SampleFunctionsApp\publish* directory. Name the zipped folder *publish.zip*.
129
130
130
-
>[!TIP]
131
-
>If you're using PowerShell, you can create the zip by copying the full path to that *\publish* directory and pasting it into the following command:
> The cmdlet will create the *publish.zip* file in the directory location of your console.
131
+
>[!IMPORTANT]
132
+
>Make sure the zipped folder does not include an extra layer for the *publish* folder itself. It should only contain the contents that were inside the *publish* folder.
137
133
138
-
Your *publish.zip* file should contain folders for *bin*, *ProcessDTRoutedData*, and *ProcessHubToDTEvents*, and there should also be a *host.json* file.
134
+
Here's an image of how the zip contents might look (it may change depending on your version of .NET).
139
135
140
136
:::image type="content" source="media/tutorial-end-to-end/publish-zip.png" alt-text="Screenshot of File Explorer in Windows showing the contents of the publish zip folder.":::
141
137
@@ -193,7 +189,7 @@ The first setting gives the function app the **Azure Digital Twins Data Owner**
193
189
194
190
The result of this command is outputted information about the role assignment you've created. The function app now has permissions to access data in your Azure Digital Twins instance.
195
191
196
-
#### Configure application settings
192
+
#### Configure application setting
197
193
198
194
The second setting creates an environment variable for the function with the URL of your Azure Digital Twins instance. The function code will use the value of this variable to refer to your instance. For more information about environment variables, see [Manage your function app](../azure-functions/functions-how-to-use-azure-function-app-settings.md?tabs=portal).
199
195
@@ -273,7 +269,7 @@ The output is information about the device that was created.
273
269
274
270
Next, configure the device simulator to send data to your IoT Hub instance.
275
271
276
-
Begin by getting the IoT hub connection string with this command:
272
+
Begin by getting the IoT hub connection string with the following command. The connection string value will start with `HostName=`.
277
273
278
274
```azurecli-interactive
279
275
az iot hub connection-string show --hub-name <your-IoT-hub-name>
@@ -320,6 +316,10 @@ The *ProcessHubToDTEvents* function you published earlier listens to the IoT Hub
320
316
321
317
To see the data from the Azure Digital Twins side, switch to your other console window that's open to the *AdtSampleApp\SampleClientApp* folder. Run the *SampleClientApp* project with `dotnet run`.
322
318
319
+
```cmd/sh
320
+
dotnet run
321
+
```
322
+
323
323
Once the project is running and accepting commands, run the following command to get the temperatures being reported by the digital twin thermostat67:
324
324
325
325
```cmd/sh
@@ -397,7 +397,7 @@ Here's a review of the scenario that you built in this tutorial.
397
397
2. Simulated device telemetry is sent to IoT Hub, where the *ProcessHubToDTEvents* Azure function is listening for telemetry events. The *ProcessHubToDTEvents* Azure function uses the information in these events to set the `Temperature` property on thermostat67 (**arrow B** in the diagram).
398
398
3. Property change events in Azure Digital Twins are routed to an Event Grid topic, where the *ProcessDTRoutedData* Azure function is listening for events. The *ProcessDTRoutedData* Azure function uses the information in these events to set the `Temperature` property on room21 (**arrow C** in the diagram).
399
399
400
-
:::image type="content" source="media/tutorial-end-to-end/building-scenario.png" alt-text="Diagram of the full building scenario, which shows the data flowing from a device into and out of Azure Digital Twins through various Azure services.":::
400
+
:::image type="content" source="media/tutorial-end-to-end/building-scenario.png" alt-text="Diagram from the beginning of the article showing the full building scenario.":::
Copy file name to clipboardExpand all lines: includes/digital-twins-tutorial-sample-prereqs.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,15 @@ author: baanders
3
3
description: prerequisites for Azure Digital Twins tutorials
4
4
ms.service: digital-twins
5
5
ms.topic: include
6
-
ms.date: 9/26/2022
6
+
ms.date: 9/12/2023
7
7
ms.author: baanders
8
8
---
9
9
10
10
## Prerequisites
11
11
12
12
Before beginning this tutorial, start with these prerequisites:
13
13
* If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
14
-
* This tutorial uses .NET Core 3.1. You can download this version of the .NET Core SDK for multiple platforms from [Download .NET Core 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1).
14
+
* This tutorial uses .NET. You can download the latest version of the .NET SDK for multiple platforms from [Download .NET](https://dotnet.microsoft.com/download).
15
15
16
16
Then, continue through the rest of this section to set up the remaining prerequisites.
0 commit comments