Trigger API from web page and encounter CORS error

Amy Z 301 Reputation points
2021-12-28T10:37:48.487+00:00

Hi, our API consumer encounters CORS error when triggering APIs hosted on Azure API management.
The consumer system is power app portal and triggers API from web page.
Here's the glance

160931-image.png

From APIM side, we already enable related settings but with no luck.
160941-image.png

Do you experts have any idea about what else could be done to pass this CORS check ?

Thank you very much

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2022-01-03T07:02:51.423+00:00

    @Amy Z Your policy looks good and it seems that the browser is blocking the request not the API management gateway. Can you test the same request from the postman/fiddler and verify if it succeeded. If the request contains headers that are not allowed in the "allowed headers" list, CORS headers will not be returned. You don't have to allow all headers, you can add the ones that are being passed with requests that need to be allowed and see if it resolves the issue.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.