Routing API resulting in 500 Internal Server Error

John Finegan 0 Reputation points
2025-05-28T19:35:14.73+00:00

We need to find the shortest road distance between two points and are utilizing the avoid ferries properties in our requests, however we are finding that some ferries are causing a 500 Internal Server Error response from the API.

POST: https://atlas.microsoft.com/route/directions?api-version=2025-01-01&subscription-key={{subscriptionKey}}

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          -86.2791608,
          43.9528082
        ],
        "type": "Point"
      },
      "properties": {
        "pointIndex": 0,
        "pointType": "waypoint"
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          -87.821335,
          44.1444086
        ],
        "type": "Point"
      },
      "properties": {
        "pointIndex": 1,
        "pointType": "waypoint"
      }
    }
  ],
  "optimizeRoute": "shortest",
  "avoid": [ "ferries" ],
  "routeOutputOptions": [ "routeSummary" ]
}

This was an example that I found that pretty consistently failed for me that by the shortest distance would use the Ludington-Manitowoc ferry across Lake Michigan. If I remove the avoid ferries property, this exact request would work and I would get a response from the API. However, since I need to avoid ferries, the API has been responding with 500 Internal Server Error.

The headers and response are below.

Name Value
transfer-encoding chunked
content-type application/json; charset=utf-8
vary Accept-Encoding
x-ms-azuremaps-region East US
x-content-type-options nosniff
strict-transport-security max-age=31536000; includeSubDomains
traceid 62d8542e0d9441d393c23b840fa1aecb
x-cache CONFIG_NOCACHE
x-msedge-ref Ref A: 62D8542E0D9441D393C23B840FA1AECB Ref B: ATL331000108037 Ref C: 2025-05-28T19:30:32Z
date Wed, 28 May 2025 19:30:43 GMT
{
  "error": {
    "code": "InternalServerError",
    "message": "An error occurred while processing the request. Please try again later."
  }
}
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
833 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.