An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
From your description, the 403 error on the Azure Maps styling endpoint means the request is being blocked, most likely due to authentication or how the request is being sent from iOS WKWebView.
Let me explain this in a simple way:
First, what this error means A 403 error usually means the request is reaching the service, but Azure Maps is not accepting it. This typically happens when the authentication is missing, not valid, or not being passed correctly.
Second, check authentication carefully Even if you added the subscription key, in WKWebView sometimes it is not applied correctly.
Please check
- your subscription key is correct and active
- the key is actually being passed in the map initialization code
- there are no script errors preventing the key from being used
If authentication is not applied correctly, Azure Maps will return 401 or 403 errors, and the map will not load properly.
Third, test the same page outside iOS This is very important.
Try opening the same HTML or JavaScript code in
- Safari browser
- desktop browser
If it works there but not in WKWebView, then the issue is not with Azure Maps, but with how WKWebView is loading or handling the request.
Fourth, check WKWebView behavior WKWebView sometimes behaves differently compared to normal browsers
Possible things to check
- headers might not be passed correctly
- script loading may not complete properly
- JavaScript errors might stop execution early
Because of this, the map control may call the styles API without proper authentication attached
Fifth, check browser console logs Use WKWebView debugging or test in Safari to look at
- console errors
- network requests
- failed API calls
Sometimes a small JavaScript issue can prevent authentication from being applied correctly.
Sixth, confirm migration is clean If you moved from native iOS SDK to Web SDK
Make sure
- only Web SDK code is used
- no leftover native SDK configuration exists
- initialization follows Web SDK pattern fully
Mixing both approaches can sometimes cause unexpected behavior.
Simple way to identify the issue
- if it fails everywhere then it is auth issue
- if it works in browser but not WKWebView then it is environment issue
Official reference for setup and migration https://learn.microsoft.com/en-us/azure/azure-maps/ios-sdk-migration-guide
In short: This error is usually caused by authentication not being applied correctly or WKWebView not sending the request in the expected way Start by validating auth and then compare behavior between browser and WKWebView.
Hope this helps you narrow down the issue quickly. Do let me know if you have any further queries.
Thankyou!