Problem:
I get the following error when I try an use a WEB API deployed to Azure App Service Web App:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Solution:
Enable Cross-Origin Resource Sharing (CORS) on your Azure App Service Web App.
Explanation:
- From the Azure Portal locate your App Service that is hosting your WEB API
- Click CORS
- Enter the full URL of the site you want to allow to access your WEB API or * to allow all domains
- Click Save
Now you should be able to access your WEB API.