Azure CORS Policy Issue

Satva Solutions 1 Reputation point
2020-11-23T08:20:23.267+00:00

I created two web apps for frontend app(for angular) and backend(for .net core web api) in azure
When we access the API we get the following error.

  1. Access From Global Environment : Error: "Access to XMLHttpRequest at 'https://api.kdgtest.com/api/GoogleCalendars/GetGoogleCalenderList?viewMode=true' from origin 'https://mountainfoundation.kdgtest.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

2) Access From Local Environment : Error: "Access to XMLHttpRequest at 'https://api.kdgtest.com/api/GoogleCalendars/GetGoogleCalenderList?viewMode=true' from origin 'http://localhost:2019' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

Please give me a proper solution for resolved the above error. Please let me know Do we need to change the Azure app(backend) or change the backend project (using the Net Core Web API)?

Please let me know if you have any questions regarding the above error.

Thanks,
Nilesh

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,407 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 15,791 Reputation points Microsoft Employee
    2020-11-26T02:31:55.767+00:00

    @Satva Solutions Please let us know if you've received our request to reach out as we mentioned in the private message we sent to you. If the issue is resolved, we would appreciate if you shared the solution with the community to help out others who might have a similar issue in the future.

    We look forward to your reply.

    0 comments No comments