An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
Hello Andrew !
Thank you for posting on MS Learn Q&A.
Try to check the waypoint coordinate order. The new API uses GeoJSON, so coordinates must be sent as [longitude, latitude], not [latitude, longitude].
The coordinates in the question appear to be York / Scarborough style latitude longitude pairs:
[53.96119, -1.09768],
[54.29296, -0.40703],
[53.96119, -1.09768]
For Azure Maps Route Directions they should be:
[-1.09768, 53.96119],
[-0.40703, 54.29296],
[-1.09768, 53.96119]
If sent in the original order, Azure Maps interprets them as longitude 53.x and latitude -1.x, which places the points somewhere completely different and likely not on a routable road network. That can explain the empty FeatureCollection.
Regarding the empty features array, the current API doc defines a successful response as a GeoJSON FeatureCollection, and errors are returned separately as Maps error responses. I would not rely only on anInvalid Route error message for no-route cases. In client code, treat 200 OK with features: [] as no route returned / not routable and handle it explicitly.
So try to swap the coordinate order first then retest.