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/how-to-integrate-azure-signalr.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,8 +61,8 @@ Leave the browser window open to the Azure portal, as you'll use it again in the
61
61
## Publish and configure the Azure Functions app
62
62
63
63
In this section, you'll set up two Azure functions:
64
-
* negotiate - A HTTP trigger function. It uses the *SignalRConnectionInfo* input binding to generate and return valid connection information.
65
-
* broadcast - An [Event Grid](../event-grid/overview.md) trigger function. It receives Azure Digital Twins telemetry data through the event grid, and uses the output binding of the SignalR instance you created in the previous step to broadcast the message to all connected client applications.
64
+
**negotiate* - A HTTP trigger function. It uses the *SignalRConnectionInfo* input binding to generate and return valid connection information.
65
+
**broadcast* - An [Event Grid](../event-grid/overview.md) trigger function. It receives Azure Digital Twins telemetry data through the event grid, and uses the output binding of the SignalR instance you created in the previous step to broadcast the message to all connected client applications.
66
66
67
67
Start Visual Studio (or another code editor of your choice), and open the code solution in the *digital-twins-samples-master > ADTSampleApp* folder. Then do the following steps to create the functions:
68
68
@@ -103,9 +103,9 @@ Next, configure the function to communicate with your Azure SignalR instance. Yo
103
103
104
104
## Connect the function to Event Grid
105
105
106
-
Next, subscribe the "broadcast" Azure function to the Event Grid topic you created during the [tutorial prerequisite](how-to-integrate-azure-signalr.md#prerequisites). This action will allow telemetry data to flow from the thermostat67 twin through the Event Grid topic and to the function. From here, the function can broadcast the data to all the clients.
106
+
Next, subscribe the *broadcast* Azure function to the Event Grid topic you created during the [tutorial prerequisite](how-to-integrate-azure-signalr.md#prerequisites). This action will allow telemetry data to flow from the thermostat67 twin through the Event Grid topic and to the function. From here, the function can broadcast the data to all the clients.
107
107
108
-
To broadcast the data, you'll create an Event subscription from your Event Grid topic to your "broadcast" Azure function as an endpoint.
108
+
To broadcast the data, you'll create an Event subscription from your Event Grid topic to your *broadcast* Azure function as an endpoint.
109
109
110
110
In the [Azure portal](https://portal.azure.com/), navigate to your Event Grid topic by searching for its name in the top search bar. Select **+ Event Subscription**.
111
111
@@ -115,7 +115,7 @@ On the **Create Event Subscription** page, fill in the fields as follows (fields
115
115
* **EVENT SUBSCRIPTION DETAILS** > **Name**: Give a name to your event subscription.
116
116
* **ENDPOINT DETAILS** > **Endpoint Type**: Select **Azure Function** from the menu options.
117
117
* **ENDPOINT DETAILS** > **Endpoint**: Select the **Select an endpoint** link, which will open a **Select Azure Function** window:
118
-
- Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (*broadcast*). Some of these fields may autopopulate after selecting the subscription.
118
+
- Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (**broadcast**). Some of these fields may autopopulate after selecting the subscription.
119
119
- Select **Confirm Selection**.
120
120
121
121
:::image type="content" source="media/how-to-integrate-azure-signalr/create-event-subscription.png" alt-text="Screenshot of the form for creating an event subscription in the Azure portal.":::
@@ -132,7 +132,7 @@ In this section, you'll see the result in action. First, configure the sample cl
132
132
133
133
### Configure the sample client web app
134
134
135
-
Next, you'll configure the sample client web app. Start by gathering the HTTP endpoint URL of the "negotiate" function, and then use it to configure the app code on your machine.
135
+
Next, you'll configure the sample client web app. Start by gathering the HTTP endpoint URL of the *negotiate* function, and then use it to configure the app code on your machine.
136
136
137
137
1. Go to the Azure portal's [Function apps](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp) page and select your function app from the list. In the app menu, select **Functions** and choose the **negotiate** function.
138
138
@@ -144,7 +144,7 @@ Next, you'll configure the sample client web app. Start by gathering the HTTP en
144
144
145
145
1. Using Visual Studio or any code editor of your choice, open the unzipped _**digitaltwins-signalr-webapp-sample-main**_ folder that you downloaded in the [Download the sample applications](#download-the-sample-applications) section.
146
146
147
-
1. Open the *src/App.js* file, and replace the function URL in `HubConnectionBuilder` with the HTTP endpoint URL of the "negotiate" function that you saved in the previous step:
147
+
1. Open the *src/App.js* file, and replace the function URL in `HubConnectionBuilder` with the HTTP endpoint URL of the **negotiate** function that you saved in the previous step:
Copy file name to clipboardExpand all lines: articles/digital-twins/tutorial-end-to-end.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,8 +91,8 @@ You can now stop running the project. Keep the solution open in Visual Studio, t
91
91
## Set up the sample function app
92
92
93
93
The next step is setting up an [Azure Functions app](../azure-functions/functions-overview.md) that will be used throughout this tutorial to process data. The function app, SampleFunctionsApp, contains two functions:
94
-
* ProcessHubToDTEvents: processes incoming IoT Hub data and updates Azure Digital Twins accordingly
95
-
* ProcessDTRoutedData: processes data from digital twins, and updates the parent twins in Azure Digital Twins accordingly
94
+
**ProcessHubToDTEvents*: processes incoming IoT Hub data and updates Azure Digital Twins accordingly
95
+
**ProcessDTRoutedData*: processes data from digital twins, and updates the parent twins in Azure Digital Twins accordingly
96
96
97
97
In this section, you'll publish the pre-written function app, and ensure the function app can access Azure Digital Twins by assigning it an Azure Active Directory (Azure AD) identity. Completing these steps will allow the rest of the tutorial to use the functions inside the function app.
98
98
@@ -227,7 +227,7 @@ The output is the list of settings for the Azure Function, which should now cont
227
227
228
228
An Azure Digital Twins graph is meant to be driven by telemetry from real devices.
229
229
230
-
In this step, you'll connect a simulated thermostat device registered in [IoT Hub](../iot-hub/about-iot-hub.md) to the digital twin that represents it in Azure Digital Twins. As the simulated device emits telemetry, the data will be directed through the ProcessHubToDTEvents Azure function that triggers a corresponding update in the digital twin. In this way, the digital twin stays up to date with the real device's data. In Azure Digital Twins, the process of directing events data from one place to another is called [routing events](concepts-route-events.md).
230
+
In this step, you'll connect a simulated thermostat device registered in [IoT Hub](../iot-hub/about-iot-hub.md) to the digital twin that represents it in Azure Digital Twins. As the simulated device emits telemetry, the data will be directed through the *ProcessHubToDTEvents* Azure function that triggers a corresponding update in the digital twin. In this way, the digital twin stays up to date with the real device's data. In Azure Digital Twins, the process of directing events data from one place to another is called [routing events](concepts-route-events.md).
231
231
232
232
Processing the simulated telemetry happens in this part of the end-to-end scenario (**arrow B**):
233
233
@@ -256,7 +256,7 @@ Save the **name** that you gave to your IoT hub. You'll use it later.
256
256
257
257
### Connect the IoT hub to the Azure function
258
258
259
-
Next, connect your IoT hub to the ProcessHubToDTEvents Azure function in the function app you published earlier, so that data can flow from the device in IoT Hub through the function, which updates Azure Digital Twins.
259
+
Next, connect your IoT hub to the *ProcessHubToDTEvents* Azure function in the function app you published earlier, so that data can flow from the device in IoT Hub through the function, which updates Azure Digital Twins.
260
260
261
261
To do so, you'll create an *Event Subscription* on your IoT Hub, with the Azure function as an endpoint. This "subscribes" the function to events happening in IoT Hub.
262
262
@@ -275,7 +275,7 @@ Fill in the fields as follows (fields filled by default aren't mentioned):
275
275
***ENDPOINT DETAILS** > **Endpoint Type**: Select **Azure Function** from the menu options.
276
276
***ENDPOINT DETAILS** > **Endpoint**: Select the **Select an endpoint** link, which will open a **Select Azure Function** window:
277
277
:::image type="content" source="media/tutorial-end-to-end/event-subscription-3.png" alt-text="Screenshot of the Azure portal event subscription showing the window to select an Azure function." border="false":::
278
-
- Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (*ProcessHubToDTEvents*). Some of these values may auto-populate after selecting the subscription.
278
+
- Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (**ProcessHubToDTEvents**). Some of these values may auto-populate after selecting the subscription.
279
279
- Select **Confirm Selection**.
280
280
281
281
Back on the **Create Event Subscription** page, select **Create**.
@@ -336,7 +336,7 @@ You don't need to do anything else in this console, but leave it running while y
@@ -359,7 +359,7 @@ Once you've verified the live temperatures logging is working successfully, you
359
359
360
360
So far in this tutorial, you've seen how Azure Digital Twins can be updated from external device data. Next, you'll see how changes to one digital twin can propagate through the Azure Digital Twins graph—in other words, how to update twins from service-internal data.
361
361
362
-
To do so, you'll use the ProcessDTRoutedData Azure function to update a Room twin when the connected Thermostat twin is updated. The update functionality happens in this part of the end-to-end scenario (**arrow C**):
362
+
To do so, you'll use the *ProcessDTRoutedData* Azure function to update a Room twin when the connected Thermostat twin is updated. The update functionality happens in this part of the end-to-end scenario (**arrow C**):
363
363
364
364
:::image type="content" source="media/tutorial-end-to-end/building-scenario-c.png" alt-text="Diagram of an excerpt from the full building scenario diagram highlighting the section that shows the elements after Azure Digital Twins.":::
365
365
@@ -373,9 +373,9 @@ Here are the actions you'll complete to set up this data flow:
373
373
374
374
### Connect the Azure function
375
375
376
-
Next, subscribe the ProcessDTRoutedData Azure function to the event grid topic you created earlier, so that telemetry data can flow from the thermostat67 twin through the event grid topic to the function, which goes back into Azure Digital Twins and updates the room21 twin accordingly.
376
+
Next, subscribe the *ProcessDTRoutedData* Azure function to the event grid topic you created earlier, so that telemetry data can flow from the thermostat67 twin through the event grid topic to the function, which goes back into Azure Digital Twins and updates the room21 twin accordingly.
377
377
378
-
To do so, you'll create an Event Grid subscription that sends data from the event grid topic that you created earlier to your ProcessDTRoutedData Azure function.
378
+
To do so, you'll create an Event Grid subscription that sends data from the event grid topic that you created earlier to your *ProcessDTRoutedData* Azure function.
379
379
380
380
In the [Azure portal](https://portal.azure.com/), navigate to your event grid topic by searching for its name in the top search bar. Select **+ Event Subscription**.
381
381
@@ -387,7 +387,7 @@ On the **Create Event Subscription** page, fill in the fields as follows (fields
387
387
***EVENT SUBSCRIPTION DETAILS** > **Name**: Give a name to your event subscription.
388
388
***ENDPOINT DETAILS** > **Endpoint Type**: Select **Azure Function** from the menu options.
389
389
***ENDPOINT DETAILS** > **Endpoint**: Select the **Select an endpoint** link, which will open a **Select Azure Function** window:
390
-
- Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (*ProcessDTRoutedData*). Some of these values may auto-populate after selecting the subscription.
390
+
- Fill in your **Subscription**, **Resource group**, **Function app**, and **Function** (**ProcessDTRoutedData**). Some of these values may auto-populate after selecting the subscription.
391
391
- Select **Confirm Selection**.
392
392
393
393
Back on the **Create Event Subscription** page, select **Create**.
@@ -423,8 +423,8 @@ Once you've verified the live temperatures logging from your instance is working
423
423
Here's a review of the scenario that you built out in this tutorial.
424
424
425
425
1. An Azure Digital Twins instance digitally represents a floor, a room, and a thermostat (represented by **section A** in the diagram below)
426
-
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).
427
-
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).
426
+
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).
427
+
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).
428
428
429
429
:::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.":::
0 commit comments