I am working on a web application with front-end in react(azure static web app) and backend in dotnet(deployed as azure function). I am facing CORS errors:
Access to XMLHttpRequest at '/limitMasterDetails/segmentLimit' from origin 'https://nice-sea-xxxxxxxx.3.azurestaticapps.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I have tried following steps:
- Modify function app CORS configuration to allow origin
- Modify APIM Cors policy on API level to allow origin
- Add CORS policy in Startup.cs class.
- Modify function app host.json to allow origin
- Cleared browser cache and tried on different browser.
None of these steps have been helpful. Please advise.