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/azure-maps/azure-maps-event-grid-integration.md
+1-6Lines changed: 1 addition & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: React to Azure Maps events by using Event Grid
3
3
description: Find out how to react to Azure Maps events involving geofences. See how to listen to map events and how to use Event Grid to reroute events to event handlers.
4
4
author: eriklindeman
5
5
ms.author: eriklind
6
-
ms.date: 07/16/2020
6
+
ms.date: 01/08/2024
7
7
ms.topic: conceptual
8
8
ms.service: azure-maps
9
9
services: azure-maps
@@ -15,9 +15,6 @@ ms.custom: mvc
15
15
16
16
Azure Maps integrates with Azure Event Grid, so that users can send event notifications to other services and trigger downstream processes. The purpose of this article is to help you configure your business applications to listen to Azure Maps events. This allows users to react to critical events in a reliable, scalable, and secure manner. For example, users can build an application to update a database, create a ticket, and deliver an email notification, every time a device enters a geofence.
17
17
18
-
> [!NOTE]
19
-
> The Geofence API async event requires the region property of your Azure Maps account be set to ***Global***. When creating an Azure Maps account in the Azure portal, this isn't given as an option. For more information, see [Create an Azure Maps account with a global region].
20
-
21
18
Azure Event Grid is a fully managed event routing service, which uses a publish-subscribe model. Event Grid has built-in support for Azure services like [Azure Functions] and [Azure Logic Apps]. It can deliver event alerts to non-Azure services using webhooks. For a complete list of the event handlers that Event Grid supports, see [An introduction to Azure Event Grid].
@@ -69,7 +66,6 @@ The following example shows the schema for GeofenceResult:
69
66
70
67
Applications that handle Azure Maps geofence events should follow a few recommended practices:
71
68
72
-
* The Geofence API async event requires the region property of your Azure Maps account be set to ***Global***. When creating an Azure Maps account in the Azure portal, this isn't given as an option. For more information, see [Create an Azure Maps account with a global region].
73
69
* Configure multiple subscriptions to route events to the same event handler. It's important not to assume that events are from a particular source. Always check the message topic to ensure that the message came from the source that you expect.
74
70
* Use the `X-Correlation-id` field in the response header to understand if your information about objects is up to date. Messages can arrive out of order or after a delay.
75
71
* When a GET or a POST request in the Geofence API is called with the mode parameter set to `EnterAndExit`, then an Enter or Exit event is generated for each geometry in the geofence for which the status has changed from the previous Geofence API call.
@@ -87,6 +83,5 @@ To learn more about how to use geofencing to control operations at a constructio
Copy file name to clipboardExpand all lines: articles/azure-maps/tutorial-geofence.md
+23-38Lines changed: 23 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,40 +22,22 @@ Azure Maps provides services to support the tracking of equipment entering and e
22
22
23
23
> [!div class="checklist"]
24
24
>
25
-
> * Create an Azure Maps account with a global region.
26
25
> * Upload [Geofencing GeoJSON data] that defines the construction site areas you want to monitor. You'll upload geofences as polygon coordinates to your Azure storage account, then use the [data registry] service to register that data with your Azure Maps account.
27
26
> * Set up two [logic apps] that, when triggered, send email notifications to the construction site operations manager when equipment enters and exits the geofence area.
28
27
> * Use [Azure Event Grid] to subscribe to enter and exit events for your Azure Maps geofence. You set up two webhook event subscriptions that call the HTTP endpoints defined in your two logic apps. The logic apps then send the appropriate email notifications of equipment moving beyond or entering the geofence.
29
28
> * Use [Search Geofence Get API] to receive notifications when a piece of equipment exits and enters the geofence areas.
30
29
31
30
## Prerequisites
32
31
33
-
* This tutorial uses the [Postman] application, but you can use a different API development environment.
32
+
* An [Azure Maps account]
33
+
* A [subscription key]
34
+
* An [Azure storage account]
35
+
36
+
This tutorial uses the [Postman] application, but you can use a different API development environment.
34
37
35
38
>[!IMPORTANT]
36
39
>
37
-
> * In the URL examples, replace `{Your-Azure-Maps-Subscription-key}` with your Azure Maps subscription key.
38
-
39
-
## Create an Azure Maps account with a global region
40
-
41
-
The Geofence API async event requires the region property of your Azure Maps account be set to ***Global***. This setting isn't given as an option when creating an Azure Maps account in the Azure portal, however you do have several other options for creating a new Azure Maps account with the *global* region setting. This section lists the three methods that can be used to create an Azure Maps account with the region set to *global*.
42
-
43
-
> [!NOTE]
44
-
> The `location` property in both the ARM template and PowerShell `New-AzMapsAccount` command refer to the same property as the `Region` field in the Azure portal.
45
-
46
-
### Use an ARM template to create an Azure Maps account with a global region
47
-
48
-
[Create your Azure Maps account using an ARM template], making sure to set `location` to `global` in the `resources` section of the ARM template.
49
-
50
-
### Use PowerShell to create an Azure Maps account with a global region
51
-
52
-
```powershell
53
-
New-AzMapsAccount -ResourceGroupName your-Resource-Group -Name name-of-maps-account -SkuName g2 -Location global
54
-
```
55
-
56
-
### Use Azure CLI to create an Azure Maps account with a global region
57
-
58
-
The Azure CLI command [az maps account create] doesn’t have a location property, but defaults to `global`, making it useful for creating an Azure Maps account with a global region setting for use with the Geofence API async event.
40
+
> In the URL examples, replace `{Your-Azure-Maps-Subscription-key}` with your Azure Maps subscription key.
59
41
60
42
## Upload geofencing GeoJSON data
61
43
@@ -149,7 +131,7 @@ Create the geofence JSON file using the following geofence data. You'll upload t
149
131
}
150
132
```
151
133
152
-
Follow the steps outlined in the [How to create data registry] article to upload the geofence JSON file into your Azure storage account then register it in your Azure Maps account.
134
+
Follow the steps outlined in the [How to create data registry] article to upload the geofence JSON file into your Azure storage account and register it in your Azure Maps account.
153
135
154
136
> [!IMPORTANT]
155
137
> Make sure to make a note of the unique identifier (`udid`) value, you will need it. The `udid` is how you reference the geofence you uploaded into your Azure storage account from your source code and HTTP requests.
@@ -164,40 +146,41 @@ To create the logic apps:
164
146
165
147
2. In the upper-left corner of the Azure portal, select **Create a resource**.
166
148
167
-
3. In the **Search the Marketplace** box, type **Logic App**.
149
+
3. In the **Search services and marketplace** box, type **Logic App**.
168
150
169
151
4. From the results, select **Logic App**. Then, select **Create**.
170
152
171
153
5. On the **Logic App** page, enter the following values:
172
154
* The **Subscription** that you want to use for this logic app.
173
155
* The **Resource group** name for this logic app. You can choose to **Create new** or **Use existing** resource group.
174
156
* The **Logic App name** of your logic app. In this case, use `Equipment-Enter` as the name.
157
+
* Select **Consumption** as the **Plan type**. For more information, see [Billing and pricing models] in the Logic App documentation.
175
158
176
159
For the purposes of this tutorial, keep all other values on their default settings.
177
160
178
-
:::image type="content" source="./media/tutorial-geofence/logic-app-create.png" alt-text="Screenshot of create a logic app.":::
161
+
:::image type="content" border="false" source="./media/tutorial-geofence/logic-app-create.png" alt-text="Screenshot of create a logic app.":::
179
162
180
-
6.Select **Review + Create**. Review your settings and select **Create**.
163
+
6.When you're done, select **Review + Create**. After Azure validates the information about your logic app resource, select **Create**.
181
164
182
165
7. When the deployment completes successfully, select **Go to resource**.
183
166
184
-
8.In the **Logic App Designer**, scroll down to the **Start with a common trigger** section. Select **When an HTTP request is received**.
167
+
8.Select **Logic app designer** in the **Development Tools** section in the menu of the left, scroll down to the **Start with a common trigger** section. Select **When an HTTP request is received**.
185
168
186
-
:::image type="content" source="./media/tutorial-geofence/logic-app-trigger.png" alt-text="Screenshot of create a logic app HTTP trigger.":::
169
+
:::image type="content" border="false" source="./media/tutorial-geofence/logic-app-trigger.png" alt-text="Screenshot of create a logic app HTTP trigger.":::
187
170
188
171
9. In the upper-right corner of Logic App Designer, select **Save**. The **HTTP POST URL** is automatically generated. Save the URL. You need it in the next section to create an event endpoint.
189
172
190
-
:::image type="content" source="./media/tutorial-geofence/logic-app-httprequest.png" alt-text="Screenshot of Logic App HTTP Request URL and JSON.":::
173
+
:::image type="content" border="false" source="./media/tutorial-geofence/logic-app-httprequest.png" alt-text="Screenshot of Logic App HTTP Request URL and JSON.":::
191
174
192
175
10. Select **+ New Step**.
193
176
194
177
11. In the search box, type `outlook.com email`. In the **Actions** list, scroll down and select **Send an email (V2)**.
195
178
196
-
:::image type="content" source="./media/tutorial-geofence/logic-app-designer.png" alt-text="Screenshot of create a logic app designer.":::
179
+
:::image type="content" border="false" source="./media/tutorial-geofence/logic-app-designer.png" alt-text="Screenshot of create a logic app designer.":::
197
180
198
181
12. Sign in to your Outlook account. Make sure to select **Yes** to allow the logic app to access the account. Fill in the fields for sending an email.
199
182
200
-
:::image type="content" source="./media/tutorial-geofence/logic-app-email.png" alt-text="Screenshot of create a logic app send email step.":::
183
+
:::image type="content" border="false" source="./media/tutorial-geofence/logic-app-email.png" alt-text="Screenshot of create a logic app send email step.":::
201
184
202
185
>[!TIP]
203
186
> You can retrieve GeoJSON response data, such as `geometryId` or `deviceId`, in your email notifications. You can configure Logic Apps to read the data sent by Event Grid. For information on how to configure Logic Apps to consume and pass event data into email notifications, see [Tutorial: Send email notifications about Azure IoT Hub events using Event Grid and Logic Apps].
@@ -235,7 +218,7 @@ Create geofence exit and enter event subscriptions:
235
218
* For **Endpoint Type**, choose `Web Hook`.
236
219
* For **Endpoint**, copy the HTTP POST URL for the logic app enter endpoint that you created in the previous section. If you forgot to save it, you can just go back into Logic App Designer and copy it from the HTTP trigger step.
237
220
238
-
:::image type="content" source="./media/tutorial-geofence/events-subscription.png" alt-text="Screenshot of Azure Maps events subscription details.":::
@@ -495,7 +478,7 @@ In the preceding GeoJSON response, the equipment has remained in the main site g
495
478
496
479
In the preceding GeoJSON response, the equipment has exited the main site geofence. As a result, the `isEventPublished` parameter is set to `true`, and the Operations Manager receives an email notification indicating that the equipment has exited a geofence.
497
480
498
-
You can also [Send email notifications using Event Grid and Logic Apps] and check [Supported Events Handlers in Event Grid] using Azure Maps.
481
+
You can also [Send email notifications using Event Grid and Logic Apps]. For more information,see [Event handlers in Azure Event Grid].
499
482
500
483
## Clean up resources
501
484
@@ -506,11 +489,12 @@ There are no resources that require cleanup.
0 commit comments