APIM Policy for Cross origin

Upasana Ghosh 351 Reputation points
2023-01-09T08:52:04.377+00:00

We have CORS feature enabled API Gateway need to block / allow the Cross Origin requests

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

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-01-09T19:00:49.197+00:00

    @Upasana Ghosh Thank you for reaching out to Microsoft Q&A. Based on the statement above, you can use cors policy to set allowed origins, methods, headers etc. and refer doc for more info.

    Note, there is attribute terminate-unmatched-request which controls the processing of cross-origin requests and see the description below:

    277556-image.png

    For non-flight requests such as GET, HEAD You might see empty 200 response based on the default value (true) and hence you would have to set the attribute to false as mentioned in Scenario 7: terminate-unmatched-request in the blog.

    I hope this answers your question and feel free to add a comment if you have any other questions. We would be happy to assist you. Please ‘Upvote’ if it helped so that it can help others in the community.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Upasana Ghosh 351 Reputation points
    2023-01-11T09:18:21.36+00:00

    ............................


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.