Blazor and Azure HttpTrigger

Posted 1 year ago by NewToBlazor
0

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,
 

Someone is typing...

Post a Reply

You must be logged in to add a new post.
Number of online users: 0
An error has occurred. This application may no longer respond until reloaded. Reload 🗙