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
?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With