Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit da168ec

Browse files
committedJun 10, 2020
Edit Fixes
1 parent 6255d28 commit da168ec

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed
 

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

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,42 @@ This how-to will cover:
2727

2828
### Prerequisites
2929

30-
1. Follow the Azure Digital Twins [Tutorial: Connect an end-to-end solution](./tutorial-end-to-end.md).
31-
1. You'll be extending this twin with an additional endpoint and route. You will also be adding another function to your function app from that tutorial.
32-
2. Follow the Azure Maps [Tutorial: Use Azure Maps Creator to create indoor maps](../azure-maps/tutorial-creator-indoor-maps.md) to create an Azure Maps indoor map with a *feature stateset*.
33-
1. [Feature statesets](../azure-maps/creator-indoor-maps.md#feature-statesets) are collections of dynamic properties (states) assigned to dataset features such as rooms or equipment. In the Azure Maps tutorial above, the feature stateset stores room status that you will be displaying on a map.
34-
1. You will need your feature *stateset ID* and Azure Maps *subscription ID*.
30+
* Follow the Azure Digital Twins [Tutorial: Connect an end-to-end solution](./tutorial-end-to-end.md).
31+
* You'll be extending this twin with an additional endpoint and route. You will also be adding another function to your function app from that tutorial.
32+
* Follow the Azure Maps [Tutorial: Use Azure Maps Creator to create indoor maps](../azure-maps/tutorial-creator-indoor-maps.md) to create an Azure Maps indoor map with a *feature stateset*.
33+
* [Feature statesets](../azure-maps/creator-indoor-maps.md#feature-statesets) are collections of dynamic properties (states) assigned to dataset features such as rooms or equipment. In the Azure Maps tutorial above, the feature stateset stores room status that you will be displaying on a map.
34+
* You will need your feature *stateset ID* and Azure Maps *subscription ID*.
3535

3636
### Topology
3737

3838
The image below illustrates where the indoor maps integration elements in this tutorial fit into a larger, end-to-end Azure Digital Twins scenario.
3939

4040
:::image type="content" source="media/how-to-integrate-maps/maps-integration-topology.png" alt-text="A view 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":::
4141

42-
## Create a function to update a map using twin update notifications
42+
## Create a function to update a map when twins update
4343

44-
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 an Azure function to read those update messages and update a feature stateset in Azure Maps.
44+
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 an Azure function to read those update messages and update a feature stateset in Azure Maps.
4545

4646
## Create a route and filter to twin update notifications
4747

4848
Azure Digital Twins instances can emit twin update events whenever a twin's state is updated. The [Azure Digital Twins tutorial: 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 our maps.
4949

5050
This pattern reads from the room twin directly, rather than the IoT device, which gives us the flexibility to change the underlying data source for temperature without needing to update our 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 our map logic.
5151

52-
1. Create an Event Grid topic, which will receive events from our Azure Digital Twins instance.
53-
```azurecli
54-
az eventgrid topic create -g <your-resource-group-name> --name <your-topic-name> -l <region>
55-
```
52+
1. Create an event grid topic, which will receive events from our Azure Digital Twins instance.
53+
```azurecli
54+
az eventgrid topic create -g <your-resource-group-name> --name <your-topic-name> -l <region>
55+
```
5656
57-
2. Create an endpoint to link your Event Grid topic to Azure Digital Twins.
58-
```azurecli
59-
az dt endpoint create eventgrid --endpoint-name <Event-Grid-endpoint-name> --eventgrid-resource-group <Event-Grid-resource-group-name> --eventgrid-topic <your-Event-Grid-topic-name> -n <your-Azure-Digital-Twins-instance-name>
60-
```
57+
2. Create an endpoint to link your event grid topic to Azure Digital Twins.
58+
```azurecli
59+
az dt endpoint create eventgrid --endpoint-name <Event-Grid-endpoint-name> --eventgrid-resource-group <Event-Grid-resource-group-name> --eventgrid-topic <your-Event-Grid-topic-name> -n <your-Azure-Digital-Twins-instance-name>
60+
```
6161
6262
3. Create a route in Azure Digital Twins to send twin update events to your endpoint.
63-
64-
```azurecli
65-
az dt route create -n <your-Azure-Digital-Twins-instance-name> --endpoint-name <Event-Grid-endpoint-name> --route-name <my_route> --filter "{ "endpointId": "<endpoint-ID>","filter": "type = 'Microsoft.DigitalTwins.Twin.Update'"}"
66-
```
63+
```azurecli
64+
az dt route create -n <your-Azure-Digital-Twins-instance-name> --endpoint-name <Event-Grid-endpoint-name> --route-name <my_route> --filter "{ "endpointId": "<endpoint-ID>","filter": "type = 'Microsoft.DigitalTwins.Twin.Update'"}"
65+
```
6766
6867
## Create an Azure function to update maps
6968
@@ -149,7 +148,7 @@ Both samples send temperature in a compatible range, so you should see the color
149148

150149
:::image type="content" source="media/how-to-integrate-maps/maps-temperature-update.png" alt-text="An office map showing room 121 colored orange":::
151150

152-
## Store your maps information in the Azure Digital Twins graph
151+
## Store your maps information in Azure Digital Twins
153152

154153
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 would include the stateset ID, maps subscription ID, and feature ID of each map and location respectively.
155154

Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.