Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting cors via az webapp - Missing Access-Control-Allow-Credentials options

Tags:

I have a devops pipeline set up to clear cors and add them again like so to make the build the definer of all settings:

az webapp cors remove-g XXX -n XXX -a
call az webapp cors add  -g XXX -n XXX -a %1

Which works fine. It clears all previously added cors and adds the paramaterised value to cors. However the check box in azure for Enable Access-Control-Allow-Credentials gets unchecked everytime. I cannot find anywhere in the azure docs how to set this value:

https://docs.microsoft.com/en-us/cli/azure/webapp/cors?view=azure-cli-latest#az-webapp-cors-add

Does anyone know how to set this to true on set use of az webapp cors add ?

like image 959
Baz G Avatar asked May 18 '19 15:05

Baz G


1 Answers

At this moment you cannot use az webapp cors add to enable Access-Control-Allow-Credentials. It was already suggested to add a supportCredential parameter, but the issue was closed.

However, you can use another command to enable it:

az resource update --name web --resource-group <resource_group> \
  --namespace Microsoft.Web --resource-type config \
  --parent sites/<app_name> --set properties.cors.supportCredentials=true

Read more on App Service documentation.

like image 137
gmsantos Avatar answered Sep 28 '22 05:09

gmsantos