Skip to content

Commit 501cc30

Browse files
committed
Update
1 parent d694a4e commit 501cc30

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed
41.9 KB
Loading

articles/digital-twins/tutorial-end-to-end.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ titleSuffix: Azure Digital Twins
44
description: Follow this tutorial to learn how to build out an end-to-end Azure Digital Twins solution that's driven by device data.
55
author: baanders
66
ms.author: baanders # Microsoft employees only
7-
ms.date: 09/26/2022
7+
ms.date: 09/12/2023
88
ms.topic: tutorial
99
ms.service: digital-twins
1010
ms.custom: engagement-fy23, devx-track-azurecli
1111

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.
1213
# Optional fields. Don't forget to remove # if you need a field.
1314
# ms.custom: can-be-multiple-comma-separated
1415
# manager: MSFT-alias-of-manager-or-PM-counterpart
@@ -25,7 +26,7 @@ In this tutorial, you will...
2526
> * 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
2627
> * Propagate changes through the twin graph by processing digital twin notifications with Azure Functions, endpoints, and routes
2728
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)]
2930

3031
[!INCLUDE [azure-cli-prepare-your-environment.md](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment-h3.md)]
3132

@@ -99,7 +100,7 @@ The function app is part of the sample project you downloaded, located in the *d
99100

100101
### Publish the app
101102

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.
103104

104105
1. Create an Azure storage account by running the following command:
105106

@@ -110,7 +111,7 @@ To publish the function app to Azure, you'll need to create a storage account, t
110111
1. Create an Azure function app by running the following command:
111112
112113
```azurecli-interactive
113-
az functionapp create --name <name-for-new-function-app> --storage-account <name-of-storage-account-from-previous-step> --functions-version 4 --consumption-plan-location <location> --runtime dotnet --runtime-version 6 --resource-group <resource-group>
114+
az functionapp create --name <name-for-new-function-app> --storage-account <name-of-storage-account-from-previous-step> --functions-version 4 --consumption-plan-location <location> --runtime dotnet-isolated --runtime-version 7 --resource-group <resource-group>
114115
```
115116
116117
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
120121
1. In the console, run the following command to publish the project locally:
121122
122123
```cmd/sh
123-
dotnet publish -c Release
124+
dotnet publish -c Release -o publish
124125
```
125126
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.
127128
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*.
129130
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:
132-
>
133-
>```powershell
134-
>Compress-Archive -Path <full-path-to-publish-directory>\* -DestinationPath .\publish.zip
135-
>```
136-
> 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.
137133
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).
139135
140136
:::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.":::
141137
@@ -193,7 +189,7 @@ The first setting gives the function app the **Azure Digital Twins Data Owner**
193189
194190
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.
195191
196-
#### Configure application settings
192+
#### Configure application setting
197193
198194
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).
199195
@@ -273,7 +269,7 @@ The output is information about the device that was created.
273269

274270
Next, configure the device simulator to send data to your IoT Hub instance.
275271

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=`.
277273

278274
```azurecli-interactive
279275
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
320316

321317
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`.
322318

319+
```cmd/sh
320+
dotnet run
321+
```
322+
323323
Once the project is running and accepting commands, run the following command to get the temperatures being reported by the digital twin thermostat67:
324324

325325
```cmd/sh
@@ -397,7 +397,7 @@ Here's a review of the scenario that you built in this tutorial.
397397
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).
398398
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).
399399

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.":::
401401

402402
## Clean up resources
403403

includes/digital-twins-tutorial-sample-prereqs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ author: baanders
33
description: prerequisites for Azure Digital Twins tutorials
44
ms.service: digital-twins
55
ms.topic: include
6-
ms.date: 9/26/2022
6+
ms.date: 9/12/2023
77
ms.author: baanders
88
---
99

1010
## Prerequisites
1111

1212
Before beginning this tutorial, start with these prerequisites:
1313
* 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).
1515

1616
Then, continue through the rest of this section to set up the remaining prerequisites.
1717

0 commit comments

Comments
 (0)