Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hi @Kylie Dev
1. Can I combine Azure Maps Search with the Weather API?
Yes. In fact, you need to, because the Weather API only accepts coordinates. From Get Daily Forecast, the query parameter is:
"The applicable query specified as a comma separated string composed by latitude followed by longitude e.g. "47.641268,-122.125679"."
A typical flow is:
- User enters a city name or ZIP code.
- Use Azure Maps Search to get the latitude and longitude.
- Pass those coordinates to the Weather API.
Example:
GET https://atlas.microsoft.com/weather/forecast/daily/json?api-version=1.1&query={lat},{lon}&duration=15
duration accepts 1, 5, 10, 15, 25 or 45 days. For snowfall, the daily forecast response includes snowProbability, hoursOfSnow and a snow object, so the data you need is already in there.
2. How do I keep the Azure Maps key out of the browser?
A key in your front-end code is readable by anyone who looks, so it is worth moving before you launch. From Authentication with Azure Maps:
"Primary and Secondary keys should be treated as sensitive data."
Since you're already using App Service, the simplest approach is to keep the key on the server and have your backend call Azure Maps. The browser then talks only to your API and never sees the key.
If you prefer not to proxy, Azure Maps also supports Microsoft Entra authentication and SAS tokens. For browser applications, see Secure a single page application with user sign-in.
If you go the Entra route specifically, you can also set disableLocalAuth on the Maps account. Worth knowing what that covers:
"When true, all authentication to the Azure Maps data-plane REST API is disabled, except Microsoft Entra authentication."
So it rules out SAS tokens as well as keys, which makes it a good lock once you are fully on Entra and a problem if you still need either.
Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.