Skip to content

Commit 3b05e72

Browse files
authored
Merge pull request #251135 from stevemunk/tutorial-geofence-depricated
replace data upload instructions with data registry instructions.
2 parents f6ac443 + eec48cd commit 3b05e72

File tree

2 files changed

+19
-109
lines changed

2 files changed

+19
-109
lines changed
Binary file not shown.

articles/azure-maps/tutorial-geofence.md

Lines changed: 19 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Tutorial: Create a geofence and track devices on a Microsoft Azure Map'
33
description: Tutorial on how to set up a geofence. See how to track devices relative to the geofence by using the Azure Maps Spatial service
44
author: eriklindeman
55
ms.author: eriklind
6-
ms.date: 02/28/2021
6+
ms.date: 09/14/2023
77
ms.topic: tutorial
88
ms.service: azure-maps
99
services: azure-maps
@@ -23,7 +23,7 @@ Azure Maps provides services to support the tracking of equipment entering and e
2323
> [!div class="checklist"]
2424
>
2525
> * Create an Azure Maps account with a global region.
26-
> * Upload [Geofencing GeoJSON data] that defines the construction site areas you want to monitor. You'll use the [Data Upload API] to upload geofences as polygon coordinates to your Azure Maps account.
26+
> * 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.
2727
> * 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.
2828
> * 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.
2929
> * Use [Search Geofence Get API] to receive notifications when a piece of equipment exits and enters the geofence areas.
@@ -61,32 +61,7 @@ The Azure CLI command [az maps account create] doesn’t have a location propert
6161

6262
This tutorial demonstrates how to upload geofencing GeoJSON data that contains a `FeatureCollection`. The `FeatureCollection` contains two geofences that define polygonal areas within the construction site. The first geofence has no time expiration or restrictions. The second can only be queried against during business hours (9:00 AM-5:00 PM in the Pacific Time zone), and will no longer be valid after January 1, 2022. For more information on the GeoJSON format, see [Geofencing GeoJSON data].
6363

64-
>[!TIP]
65-
>You can update your geofencing data at any time. For more information, see [Data Upload API].
66-
67-
To upload the geofencing GeoJSON data:
68-
69-
1. In the Postman app, select **New**.
70-
71-
2. In the **Create New** window, select **HTTP Request**.
72-
73-
3. Enter a **Request name** for the request, such as *POST GeoJSON Data Upload*.
74-
75-
4. Select the **POST** HTTP method.
76-
77-
5. Enter the following URL. The request should look like the following URL:
78-
79-
```HTTP
80-
https://us.atlas.microsoft.com/mapData?subscription-key={Your-Azure-Maps-Subscription-key}&api-version=2.0&dataFormat=geojson
81-
```
82-
83-
The `geojson` parameter in the URL path represents the data format of the data being uploaded.
84-
85-
6. Select the **Body** tab.
86-
87-
7. In the dropdown lists, select **raw** and **JSON**.
88-
89-
8. Copy the following GeoJSON data, and then paste it in the **Body** window:
64+
Create the geofence JSON file using the following geofence data. You'll upload this file into your Azure storage account next.
9065

9166
```JSON
9267
{
@@ -174,74 +149,10 @@ To upload the geofencing GeoJSON data:
174149
}
175150
```
176151

177-
9. Select **Send**.
178-
179-
10. In the response window, select the **Headers** tab.
180-
181-
11. Copy the value of the **Operation-Location** key, which is the `status URL`. The `status URL` is used to check the status of the GeoJSON data upload.
182-
183-
```http
184-
https://us.atlas.microsoft.com/mapData/operations/{operationId}?api-version=2.0
185-
```
186-
187-
### Check the GeoJSON data upload status
188-
189-
To check the status of the GeoJSON data and retrieve its unique ID (`udid`):
190-
191-
1. Select **New**.
192-
193-
2. In the **Create New** window, select **HTTP Request**.
194-
195-
3. Enter a **Request name** for the request, such as *GET Data Upload Status*.
196-
197-
4. Select the **GET** HTTP method.
198-
199-
5. Enter the `status URL` you copied in [Upload Geofencing GeoJSON data]. The request should look like the following URL:
200-
201-
```HTTP
202-
https://us.atlas.microsoft.com/mapData/{operationId}?api-version=2.0&subscription-key={Your-Azure-Maps-Subscription-key}
203-
```
204-
205-
6. Select **Send**.
206-
207-
7. In the response window, select the **Headers** tab.
208-
209-
8. Copy the value of the **Resource-Location** key, which is the `resource location URL`. The `resource location URL` contains the unique identifier (`udid`) of the uploaded data. Save the `udid` to query the Get Geofence API in the last section of this tutorial.
210-
211-
:::image type="content" source="./media/tutorial-geofence/resource-location-url.png" alt-text="Copy the resource location URL.":::
212-
213-
### (Optional) Retrieve GeoJSON data metadata
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.
214153

215-
You can retrieve metadata from the uploaded data. The metadata contains information like the resource location URL, creation date, updated date, size, and upload status.
216-
217-
To retrieve content metadata:
218-
219-
1. Select **New**.
220-
221-
2. In the **Create New** window, select **HTTP Request**.
222-
223-
3. Enter a **Request name** for the request, such as *GET Data Upload Metadata*.
224-
225-
4. Select the **GET** HTTP method.
226-
227-
5. Enter the `resource Location URL` you copied in [Check the GeoJSON data upload status]. The request should look like the following URL:
228-
229-
```http
230-
https://us.atlas.microsoft.com/mapData/metadata/{udid}?api-version=2.0&subscription-key={Your-Azure-Maps-Subscription-key}
231-
```
232-
233-
6. In the response window, select the **Body** tab. The metadata should like the following JSON fragment:
234-
235-
```json
236-
{
237-
"udid": "{udid}",
238-
"location": "https://us.atlas.microsoft.com/mapData/6ebf1ae1-2a66-760b-e28c-b9381fcff335?api-version=2.0",
239-
"created": "5/18/2021 8:10:32 PM +00:00",
240-
"updated": "5/18/2021 8:10:37 PM +00:00",
241-
"sizeInBytes": 946901,
242-
"uploadStatus": "Completed"
243-
}
244-
```
154+
> [!IMPORTANT]
155+
> Make sure to make a note of the unique identifier (`udid`) value, you will need it. The `udid` is is how you reference the geofence you uploaded into your Azure storage account from your source code and HTTP requests.
245156
246157
## Create workflows in Azure Logic Apps
247158

@@ -592,22 +503,21 @@ There are no resources that require cleanup.
592503
> [!div class="nextstepaction"]
593504
> [Handle content types in Azure Logic Apps]
594505

595-
[Geofencing GeoJSON data]: geofence-geojson.md
596-
[Data Upload API]: /rest/api/maps/data-v2/upload
597-
[logic apps]: ../event-grid/handler-webhooks.md#logic-apps
506+
[az maps account create]: /cli/azure/maps/account?view=azure-cli-latest&preserve-view=true#az-maps-account-create
598507
[Azure Event Grid]: ../event-grid/overview.md
599-
[Search Geofence Get API]: /rest/api/maps/spatial/getgeofence
600-
[Postman]: https://www.postman.com
508+
[Azure portal]: https://portal.azure.com
601509
[Create your Azure Maps account using an ARM template]: how-to-create-template.md
602-
[az maps account create]: /cli/azure/maps/account?view=azure-cli-latest&preserve-view=true#az-maps-account-create
603-
[Upload Geofencing GeoJSON data]: #upload-geofencing-geojson-data
604-
[Check the GeoJSON data upload status]: #check-the-geojson-data-upload-status
510+
[data registry]: /rest/api/maps/data-registry
511+
[Geofencing GeoJSON data]: geofence-geojson.md
512+
[Handle content types in Azure Logic Apps]: ../logic-apps/logic-apps-content-type.md
513+
[How to create data registry]: how-to-create-data-registries.md
605514
[logic app]: ../event-grid/handler-webhooks.md#logic-apps
606-
[Azure portal]: https://portal.azure.com
607-
[Tutorial: Send email notifications about Azure IoT Hub events using Event Grid and Logic Apps]: ../event-grid/publish-iot-hub-events-to-logic-apps.md
608-
[three event types]: ../event-grid/event-schema-azure-maps.md
609-
[Spatial Geofence Get API]: /rest/api/maps/spatial/getgeofence
610-
[Upload Geofencing GeoJSON data section]: #upload-geofencing-geojson-data
515+
[logic apps]: ../event-grid/handler-webhooks.md#logic-apps
516+
[Postman]: https://www.postman.com
517+
[Search Geofence Get API]: /rest/api/maps/spatial/getgeofence
611518
[Send email notifications using Event Grid and Logic Apps]: ../event-grid/publish-iot-hub-events-to-logic-apps.md
519+
[Spatial Geofence Get API]: /rest/api/maps/spatial/getgeofence
612520
[Supported Events Handlers in Event Grid]: ../event-grid/event-handlers.md
613-
[Handle content types in Azure Logic Apps]: ../logic-apps/logic-apps-content-type.md
521+
[three event types]: ../event-grid/event-schema-azure-maps.md
522+
[Tutorial: Send email notifications about Azure IoT Hub events using Event Grid and Logic Apps]: ../event-grid/publish-iot-hub-events-to-logic-apps.md
523+
[Upload Geofencing GeoJSON data section]: #upload-geofencing-geojson-data

0 commit comments

Comments
 (0)