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.
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.
Azure Maps events types
Event Grid uses event subscriptions to route event messages to subscribers. An Azure Maps account emits the following event types:
Event type
Description
Microsoft.Maps.GeofenceEntered
Raised when received coordinates have moved from outside of a given geofence to within
Microsoft.Maps.GeofenceExited
Raised when received coordinates have moved from within a given geofence to outside
Microsoft.Maps.GeofenceResult
Raised every time a geofencing query returns a result, regardless of the state
Event schema
The following example shows the schema for GeofenceResult:
Applications that handle Azure Maps geofence events should follow a few recommended practices:
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.
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.
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.
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.
Learn about the Azure Maps TypeScript REST SDK. See how to load and use this client library to access Azure Maps REST services in web or Node.js applications.
Lists the regions Azure Maps supports with services such as maps, search, routing, weather, and traffic incidents, and shows how to set up the View parameter.
Tutorial on how to search for points of interest on a map. See how to use the Azure Maps Web SDK to add search capabilities and interactive pop-up boxes to a map.