Webapp:Multiple bugs - `az webapp config appsettings set` command
Facing two problems
-
az webapp config appsettings set -g $ResourceGroupName -n "app-name" --settings SettingKey=$SettingValue SettingKey2=$SettingValue2does not work even though the settings are space separated, it errors out. If it is set as a string it puts all of it in the one config setting (with the "()" for keyvault reference. This is relevant for the next problem.) -
az webapp config appsettings set -g $ResourceGroupName -n "app-name" --settings SettingKey=$SettingValue- Does not work properly if the$SettingValueis a keyvault reference. It sets the value in the web app but omits the last ')' causing it to not be a valid keyvault reference string.
I know this is an avenue is for page feed back, but please let me know who I can get in touch with to resolve this issue on the product itself.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 30f2ae52-2c7f-7e7e-8a62-f1b614f281d3
- Version Independent ID: 9f23ff17-14e0-7800-0094-fb50a5fa91d6
- Content: az webapp config appsettings
- Content Source: latest/docs-ref-autogen/webapp/config/appsettings.yml
- Service: app-service-web
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Service attention and for webapp
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.
@flyingUnderTheRadar Can you try putting quotations around your settings like so: --settings 'SettingKey=$SettingValue' 'SettingKey2=$SettingValue2' and let me know if the problem still persists
Appreciate your response. Ended doing doing something different. Don't have it set up to test anymore.
However just for others I ended up having to use powershell like this to make it work
$SecretKVReference= '"@Microsoft.KeyVault(SecretUri={0})"' -f $SecretString
$AnotherSecretKVReference= '"@Microsoft.KeyVault(SecretUri={0})"' -f $AnotherSecretString
az webapp config appsettings set -g $ResourceGroupName -n $WebAppName `
--settings SecretString=$SecretKVReference AnotherSecretKVReference=$AnotherSecretKVReference
@flyingUnderTheRadar Can you try putting quotations around your settings like so:
--settings 'SettingKey=$SettingValue' 'SettingKey2=$SettingValue2'and let me know if the problem still persists
Correction: I know this is a pretty old issue, but this solution doesn't work actually... When you single quote, the $settingValue doesn't get resolved any more.
Correction: I know this is a pretty old issue, but this solution doesn't work actually... When you single quote, the $settingValue doesn't get resolved any more.
This works for me:
--settings DB_PASS='"@Microsoft.KeyVault(VaultName='$kv';SecretName=DbPassword)"'
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!