Skip to content

Commit 9cef473

Browse files
authored
Merge pull request #212722 from baanders/9-27-perf-maps
ADT: Content performance September (Maps integration)
2 parents 0275866 + e7bb8b6 commit 9cef473

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

articles/digital-twins/how-to-integrate-maps.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,28 @@ ms.author: baanders # Microsoft employees only
88
ms.date: 09/27/2022
99
ms.topic: how-to
1010
ms.service: digital-twins
11+
ms.custom: contentperf-fy23q1
1112

1213
# Optional fields. Don't forget to remove # if you need a field.
1314
# ms.custom: can-be-multiple-comma-separated
1415
ms.reviewer: baanders
1516
# manager: MSFT-alias-of-manager-or-PM-counterpart
1617
---
1718

18-
# Use Azure Digital Twins to update an Azure Maps indoor map
19+
# Integrate Azure Digital Twins data into an Azure Maps indoor map
1920

20-
This article walks through the steps required to use Azure Digital Twins data to update information displayed on an *indoor map* using [Azure Maps](../azure-maps/about-azure-maps.md). Azure Digital Twins stores a graph of your IoT device relationships and routes telemetry to different endpoints, making it the perfect service for updating informational overlays on maps.
21+
This article shows how to use Azure Digital Twins data to update information displayed on an *indoor map* from [Azure Maps](../azure-maps/about-azure-maps.md). Because Azure Digital Twins stores a graph of your IoT device relationships and routes telemetry to different endpoints, it's a great service for updating informational overlays on maps.
2122

22-
This guide will cover:
23+
This guide covers the following information:
2324

2425
1. Configuring your Azure Digital Twins instance to send twin update events to a function in [Azure Functions](../azure-functions/functions-overview.md).
2526
2. Creating a function to update an Azure Maps indoor maps feature stateset.
2627
3. Storing your maps ID and feature stateset ID in the Azure Digital Twins graph.
2728

29+
## Get started
30+
31+
This section sets additional context for the information in this article.
32+
2833
### Prerequisites
2934

3035
Before proceeding with this article, start by setting up your individual Azure Digital Twins and Azure Maps resources.
@@ -41,16 +46,14 @@ The image below illustrates where the indoor maps integration elements in this t
4146

4247
:::image type="content" source="media/how-to-integrate-maps/maps-integration-topology.png" alt-text="Diagram of Azure services in an end-to-end scenario, highlighting the Indoor Maps Integration piece." lightbox="media/how-to-integrate-maps/maps-integration-topology.png":::
4348

44-
## Create a function to update a map when twins update
45-
46-
First, you'll create a route in Azure Digital Twins to forward all twin update events to an Event Grid topic. Then, you'll use a function to read those update messages and update a feature stateset in Azure Maps.
49+
## Route twin update notifications from Azure Digital Twins
4750

48-
## Create a route and filter to twin update notifications
49-
50-
Azure Digital Twins instances can emit twin update events whenever a twin's state is updated. The Azure Digital Twins [Connect an end-to-end solution](./tutorial-end-to-end.md) linked above walks through a scenario where a thermometer is used to update a temperature attribute attached to a room's twin. You'll be extending that solution by subscribing to update notifications for twins, and using that information to update your maps.
51+
Azure Digital Twins instances can emit twin update events whenever a twin's state is updated. The Azure Digital Twins [Connect an end-to-end solution](./tutorial-end-to-end.md) linked above walks through a scenario where a thermometer is used to update a temperature attribute attached to a room's twin. This tutorial extends that solution by subscribing an Azure function to update notifications from twins, and using that function to update your maps.
5152

5253
This pattern reads from the room twin directly, rather than the IoT device, which gives you the flexibility to change the underlying data source for temperature without needing to update your mapping logic. For example, you can add multiple thermometers or set this room to share a thermometer with another room, all without needing to update your map logic.
5354

55+
First, you'll create a route in Azure Digital Twins to forward all twin update events to an Event Grid topic.
56+
5457
1. Create an Event Grid topic, which will receive events from your Azure Digital Twins instance, using the CLI command below:
5558
```azurecli-interactive
5659
az eventgrid topic create --resource-group <your-resource-group-name> --name <your-topic-name> --location <region>
@@ -72,11 +75,11 @@ This pattern reads from the room twin directly, rather than the IoT device, whic
7275
az dt route create --dt-name <your-Azure-Digital-Twins-instance-hostname-or-name> --endpoint-name <Event-Grid-endpoint-name> --route-name <my-route> --filter "type = 'Microsoft.DigitalTwins.Twin.Update'"
7376
```
7477
75-
## Create a function to update maps
78+
## Create an Azure function to receive events and update maps
7679
77-
You're going to create an Event Grid-triggered function inside your function app from the end-to-end tutorial ([Connect an end-to-end solution](./tutorial-end-to-end.md)). This function will unpack those notifications and send updates to an Azure Maps feature stateset to update the temperature of one room.
80+
In this section, you'll create a function that listens for events sent to the Event Grid topic. The function will read those update notifications and send corresponding updates to an Azure Maps feature stateset, to update the temperature of one room.
7881
79-
See the following document for reference info: [Azure Event Grid trigger for Azure Functions](../azure-functions/functions-bindings-event-grid-trigger.md).
82+
In the Azure Digital Twins tutorial [prerequisite](#prerequisites), you created a function app to store Azure functions Azure Digital Twins. Now, create a new [Event Grid-triggered Azure function](../azure-functions/functions-bindings-event-grid-trigger.md) inside the function app.
8083
8184
Replace the function code with the following code. It will filter out only updates to space twins, read the updated temperature, and send that information to Azure Maps.
8285
@@ -89,7 +92,7 @@ az functionapp config appsettings set --name <your-function-app-name> --resource
8992
az functionapp config appsettings set --name <your-function-app-name> --resource-group <your-resource-group> --settings "statesetID=<your-Azure-Maps-stateset-ID>"
9093
```
9194

92-
### View live updates on your map
95+
### View live updates in the map
9396

9497
To see live-updating temperature, follow the steps below:
9598

@@ -103,7 +106,7 @@ Both samples send temperature in a compatible range, so you should see the color
103106

104107
:::image type="content" source="media/how-to-integrate-maps/maps-temperature-update.png" alt-text="Screenshot of an office map showing room 121 colored orange.":::
105108

106-
## Store your maps information in Azure Digital Twins
109+
## Store map information in Azure Digital Twins
107110

108111
Now that you have a hardcoded solution to updating your maps information, you can use the Azure Digital Twins graph to store all of the information necessary for updating your indoor map. This information would include the stateset ID, maps subscription ID, and feature ID of each map and location respectively.
109112

0 commit comments

Comments
 (0)