Yes, there are several ways to achieve this in Azure Maps.
- Pass a point into the reverse geocoding service. If the point is near a road, it will return a position that is on the road. https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-address-reverse
- If you have a lot of points that is meant to form a path along a route, such as a GPS trace, then you can pass then as supporting points into the routing service. https://learn.microsoft.com/en-us/rest/api/maps/route/post-route-directions Here are a couple code samples:
https://azuremapscodesamples.azurewebsites.net/?sample=Snap%20drawn%20line%20to%20roads
https://azuremapscodesamples.azurewebsites.net/?sample=Snap%20points%20to%20logical%20route%20path - If you are working with individual points and are using one of the interactive map controls, you can do some math and snap to the closest road geometry in the vector tiles of the map. This is a very cheap solution (no additional cost if you are already loading the tiles for display purposes). Here is a sample:
https://azuremapscodesamples.azurewebsites.net/?sample=Basic%20snap%20to%20road%20logic - You can access the vector tiles directly and do similar math to above to create a cheap snapping solution. This is a decent amount of work to setup, but once done is really cheap.