Answer accepted by question author
AI answer
To investigate and limit unexpected Azure Maps API usage, use a combination of Azure Maps metrics and Azure support channels.
- Use Azure Maps metrics to understand usage patterns
- Sign in to the Azure portal and open the Azure Maps account.
- On the Overview page, review the snapshot metrics (Total Requests, Total Errors, Availability) over different time ranges to confirm when the spike started.
- Go to Metrics in the left menu.
- In the Metrics pane, select:
- Metric = Usage to see the usage count over time.
- Metric = Availability to confirm whether the spike is associated with errors or valid traffic.
- Adjust the Time range and Time granularity to zoom in on the period where usage ramps up. Metrics are stored for 93 days, but only 30 days can be queried at a time. If charts appear blank or partial, ensure the selected interval is β€ 30 days.
- Use Filters and Apply splitting on the metric properties (for example, API name where available) to break down usage by property values. This helps identify which Azure Maps service or API (for example, Search, Route, tiles via Web SDK) is driving the spike.
- Use Add metric to overlay multiple metrics (for example, Usage and Availability) to correlate spikes with failures or specific operations.
- Understand which services are likely generating billable transactions
Use the transaction rules to narrow down the culprit:
- Route: 1 request = 1 transaction; Route Matrix bills every four cells (Ceiling(0.25 * origins * destinations)); batch routing bills per query; Snap to Roads bills 1 transaction per request (up to 100 points).
- Search: 1 request = 1 transaction; batch search bills per location; geocode autocomplete bills 1 transaction per 10 autocomplete requests.
- Web control (SDK): 1 transaction per 15 map tiles loaded (512Γ512 tiles), typically ~1 or fewer transactions per map load.
- Use Azure Monitor / Log Analytics (if enabled) to analyze broader usage
If Azure Monitor is collecting logs for the applications that call Azure Maps, use Log Analytics to:
- Identify which components or hosts are sending the most requests.
- Correlate time windows of high Azure Maps usage with spikes in application logs.
- Detect unexpected patterns (for example, a single client IP or tenant generating most of the traffic).
- Put controls and mitigations in the calling applications
Azure Maps itself does not expose hard usage caps in the portal, so limiting damage is typically done in the client or gateway layer:
- Implement rate limiting or quotas in the application or API gateway that fronts Azure Maps.
- Cache responses where possible (for example, tile caching, search result caching) to reduce repeated calls.
- Ensure keys are not exposed in public repos or client-side code without safeguards; rotate keys if key leakage is suspected.
- Engage Microsoft support for deeper investigation
For platform-level help (for example, suspected abuse, unclear metrics, or missing analytics details):
- Use Azureβs Help + support in the portal and create a Technical support request for Azure Maps.
- For technical questions on Azure Maps features and behavior, use the Azure Maps developer forums.
- Ongoing monitoring
- Keep the Metrics charts pinned to a dashboard for continuous monitoring of Usage and Availability.
- Regularly review transaction patterns by service (Route, Search, tiles) using the transaction rules to anticipate cost and detect anomalies early.
References:
