CORS enabled, but cannot make API call from Developer Portal

Marko Ilic 35 Reputation points
2024-02-26T08:58:18.08+00:00

Hi, Having issue with API Developer Portal. When try to make a call getting error message: Unable to complete the request Since the browser initiates the request, it requires Cross-Origin Resource Sharing (CORS) enabled on the server. I have enabled CORS in API Management and it is in the global policy. What can be the issue? Regards, Marko

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,408 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Erik Jensen 15 Reputation points
    2024-04-26T18:02:24.49+00:00

    @JananiRamesh-MSFT and Marko Illic, I did want to mention that I've created an API Management in a VNET and exposed it via an application gateway and used a self-signed certificate for the HTTPS aspect.

    on the developer portal, the "Try It" function was saying that I must enable CORS which I'd done but when I opened up Edge browser's developer console I saw that even though I'd trusted the self-signed certificate on portal.customdomain.com (developer portal) I had not done so on api.customdomain.com (the api gateway) and so chrome was showing CERTIFICATE_INVALID error and it was only the developer console's UI that was saying it was a CORS error. once I navigated to https://api.customdomain.com and told the browser to proceed to the "unsafe" site.. then the developer interactive portal worked properly.

    0 comments No comments

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.