Do you happen to have some logic in your live website that's still trying to access your local development Uri at localhost:7039? Either way, this blog post might be helpful with CORS and Security Headers: https://www.hanselman.com/blog/easily-adding-security-headers-to-your-aspnet-core-web-app-and-getting-an-a-grade
Blazor and Azure HttpTrigger
Hi, I have been going through How to create serverless websites with Blazor and Azure Functions Part One - All Hands on Tech and Azure Functions and How to create serverless websites with Blazor and Azure Functions Part Two
I have set Azure Allowed Origins to * as descibed in the tutorial (second part). When I try to run the app. I get an error messages related to CORS. Some one mentioned to me that there is a way of disabling CORS in code. However I cannot find where I can do this.
Access to fetch at 'https://turkeytimeapi1.azurewebsites.net/api/fooditem/' from origin 'https://localhost:7039' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Hope someone can help. Thanks,
0 Posted 1 year ago by selliott