azure-cli: WebApp:az webapp config appsettings - changing a slot setting to a non slot setting fails

Describe the bug If you create an app setting using the --slot-setting flag then delete the app setting and recreate it with the --setting flag Azure Portal still shows it with “Deployment slot setting” ticked.

To Reproduce

  1. Create a brand new app setting by running az webapp config appsettings set --name "my-web-app" --resource-group "my-web-app-resource-group" --slot-settings MyAppSettingName="my-app-setting-value" -s stage
  2. Refresh the Configuration in Azure Portal for the affected web app and confirm the new setting is there with ‘Deployment slot setting’ ticked
  3. Deleted the newly created app setting via Azure Portal and click save
  4. Refresh the Configuration in Azure Portal and confirm the new setting has disappeared
  5. Recreate the same app setting with the same name but not as a slot-setting by running az webapp config appsettings set --name "my-web-app" --resource-group "my-web-app-resource-group" --settings MyAppSettingName="my-app-setting-value" -s stage
  6. Refresh the Configuration in Azure Portal and you can see the app setting comes back but the ‘Deployment slot setting’ is still ticked, but it shouldn’t be. However the response from the command line did show the app setting being created as a non slotSetting
[
  {
    "name": "WEBSITE_NODE_DEFAULT_VERSION",
    "slotSetting": false,
    "value": "6.9.1"
  },
  {
    "name": "MyAppSettingName",
    **"slotSetting": false**,
    "value": "my-app-setting-value"
  }
]

To confim this is just caused on the second run I… 7. Created another brand new app setting with a different name that is not a slot setting by running az webapp config appsettings set --name "my-web-app" --resource-group "my-web-app-resource-group" --settings MyNEWAppSettingName="my-app-setting-value" -s stage 8. Refreshed the Configuration in Azure Portal. Now I have two app settings: MyAppSettingName: ‘Deployment slot setting’ ticked - not expected MyNEWAppSettingName: ‘Deployment slot setting’ unticked - as expected

Expected behavior When running step 5 above the ‘Deployment slot setting’ should be unticked in Azure Portal

Environment summary CLI version 2.30.0 Powershell Version 7.0.4 Powershell Edition Core OS Microsoft Windows 10.0.19043

Additional context Running commands from Microsoft Code Terminal

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

I’m also experiencing this issue, per the following:

  • Set app settings in bulk with the CLI via a JSON file where all settings have "slotSetting": "false"
  • See all app settings that were set are marked as deployment slot settings
  • Any attempt to update settings, even using the key=value CLI syntax, fails to overwrite deployment slot setting attr although output from CLI command will show slotSetting: false

However, when I update app settings in bulk via key=value key2=value2 ... CLI syntax, deployment slot setting is appropriately disabled for the provided settings.

Are there any updates on resolving these issues? Thanks!