On this topic, it would be good to understand your expectation of such a service. There are several ways to accomplish what is being asked here, but they have different levels of accuracy:
- Calculate the straight line distance from a point to the center point of every nearby city. This is fairly easy, but is completely dependent on the center point of the city. cross through the search area. Large cities may have large areas that overlap your search area, but the center point doesn't.
- Do an intersection test on city boundary data. This is much more expensive to accomplish, but much more accurate. However, there isn't well known boundary data available for all cities globally.
- Both of the above are based on straight line distance, but in most scenarios end users are more interested in travel time or distance. For that you can use the route range service in Azure Maps to generate an isochrone polygon which can then be used to do an intersection test on one of the two approaches above.
If #1 is suitable for your scenario, or 1 + 3, you can get a list of city point locations for free from GeoNames: https://www.geonames.org/ (Lots of other sources out there too, but geonames has been around for ages and most other sites use this as a data source. Its also updated regularly).