0

When trying to communicate to my Azure APIM endpoint from localhost, I am getting a CORS preflight fail. I've modified the policy on both APIM and the .Net Core API itself but I'm still not having luck. The below is how my policy looks on the 'All Operations' section in APIM. The front end is an angular application if that helps at all. On the GET I am appending the ocp-apim-subscription-key in the header also.

         <cors>
            <allowed-origins>
                <origin>*</origin>
            </allowed-origins>
            <allowed-methods preflight-result-max-age="300">
                <method>*</method>
            </allowed-methods>
            <allowed-headers>
                <header>*</header>
            </allowed-headers>
            <expose-headers>
                <header>*</header>
            </expose-headers>
        </cors>

1 Answers1

0

I was able to get it resolved after working with my company's Devops team and IT administration. Apparently my companies computers need the working domain of the server APIMs IPs from azure in our Windows HOST file. Once I added that, I had no issues and the policies were able to work.