Azure-cli: Unable to set supportCredential using azure webapp cors - Please extend this functionality

Created on 30 May 2019  路  2Comments  路  Source: Azure/azure-cli

We set cors in our development pipeline using:

az webapp cors remove -g rgroup -s slotname -n sitename -a
az webapp cors add  -g rgroup -s slotname -n sitename -a http://example.net 

Works great but we are unable to set supportCredential flag to true.

We are able to do this via :

az resource update --name web --resource-group rgroup
--namespace Microsoft.Web --resource-type config --parent sites/sitename/slots/slotname 
--set properties.cors.supportCredentials true --api-version 2015-06-01

Can we get a flag on az webapp cors to set this (eg):

az webapp cors add -g rgroup -s slotname -n sitename --supportCredentials true
-a http://example.net 

This would allow us to edit all the relivant credentials using the same format for cors and set the flag in the same command as setting the cors.

Service Attention needs-triage

Most helpful comment

I was unable to get the az webapp config set --generic-configurations command you linked to actually set this flag (without needing to pass in an additional json file). Seems to be the same problem as this issue, which was also closed without any real helpful solution. What did work for me was this solution from stack overflow:

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

All 2 comments

Not something that is planned , please use https://docs.microsoft.com/en-us/cli/azure/webapp/config?view=azure-cli-latest#az-webapp-config-set azwebapp config set --generic-configurations that takes a JSON as an input & to update the cors property.

I was unable to get the az webapp config set --generic-configurations command you linked to actually set this flag (without needing to pass in an additional json file). Seems to be the same problem as this issue, which was also closed without any real helpful solution. What did work for me was this solution from stack overflow:

az resource update --name web --resource-group <resource_group> \
  --namespace Microsoft.Web --resource-type config \
  --parent sites/<app_name> --set properties.cors.supportCredentials=true
Was this page helpful?
0 / 5 - 0 ratings