2

The Azure CORS settings doesn't seem to work at all unless I specify * any and all requests will return

"has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status."

I've added my CORS http + https variants of both my production + dev environment frontend. I have also added them in the web.config.

<add name="Access-Control-Allow-Origin" value="https://LINK"/>
<add name="Access-Control-Allow-Origin" value="https://LINK/"/>

It is becoming extremely unpredictable and unreliable. The application is configured to allow all origins:

app.options('/', function(req, res) {
  res.setHeader('Access-Control-Allow-Origin', '*');
  res.setHeader('Access-Control-Allow-Methods', '*');
  res.setHeader('Access-Control-Allow-Headers', '*');
  res.end();
});

So it would send preflight data. Does azure CORS not send any preflight data? Am I better off just setting * everywhere and then managing things via the API myself? Will Azure not overwrite that configuration anyway? Am I stuck with no way of managing CORS?

1 Answer 1

1

Yes, definitely you can achieve it either by setting CORS headers from the Azure portal or by adding CORS headers from your App.

Here's how you can set it form azure portal.

  1. Navigate to azure portal
  2. Navigate to the app service you have created.
  3. Click on CORS in the app.
  4. Enter URL's in the empty Allowed Origins text box.
  5. Click Save.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.