Azure / azure-cli

Azure Command-Line Interface
MIT License
3.96k stars 2.94k forks source link

FunctionApp:Setting LinuxFxVersion to custom image with 'az functionapp config' sets WEBSITES_ENABLE_APP_SERVICE_STORAGE to false #16126

Open divyagandhisethi opened 3 years ago

divyagandhisethi commented 3 years ago

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug For a webapp, when we set LinuxFxVersion to a custom image url, we also seem to be setting 'WEBSITES_ENABLE_APPSERVICE_STORAGE' to false. The code is here: https://github.com/Azure/azure-cli/blob/ed1fe586d24b5d78127c0b616cd7e32b765d0bfc/src/azure-cli/azure/cli/command_modules/appservice/custom.py#L145-L149

To Reproduce

  1. Take any existing function app and set WEBSITES_ENABLE_APP_SERVICE_STORAGE app setting to true.

  2. Take the existing web/function app and run the az webapp config set command to update linuxfxversion to a custom/blessed functions image:

az webapp config set -g -n --subscription --linux-fx-version "DOCKER|mcr.microsoft.com/azure-functions/node:3.0.14916-node12-appservice"

  1. Then see the app settings of the function app - WEBSITES_ENABLE_APP_SERVICE_STORAGE is now set to false.

Expected behavior When updating the linuxfxversion of any existing web/function app, only the linuxfxversion should have changed. Mounting app service storage is supported in the backend for custom and blessed functions images. This hardcoded behaviour from the client side has unexpected consequences for functions customers, since they often set LinuxFxVersion to blessed functions images urls.

Environment summary

Additional context

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.

Issue Details
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62 **Describe the bug** For a webapp, when we set LinuxFxVersion to a custom image url, we also seem to be setting 'WEBSITES_ENABLE_APPSERVICE_STORAGE' to false. The code is here: https://github.com/Azure/azure-cli/blob/ed1fe586d24b5d78127c0b616cd7e32b765d0bfc/src/azure-cli/azure/cli/command_modules/appservice/custom.py#L145-L149 **To Reproduce** 1. Take any existing function app and set WEBSITES_ENABLE_APP_SERVICE_STORAGE app setting to true. 2. Take the existing web/function app and run the az webapp config set command to update linuxfxversion to a custom/blessed functions image: az webapp config set -g -n --subscription --linux-fx-version "DOCKER|mcr.microsoft.com/azure-functions/node:3.0.14916-node12-appservice" 3. Then see the app settings of the function app - WEBSITES_ENABLE_APP_SERVICE_STORAGE is now set to false. **Expected behavior** When updating the linuxfxversion of any existing web/function app, only the linuxfxversion should have changed. Mounting app service storage is supported in the backend for custom and blessed functions images. This hardcoded behaviour from the client side has unexpected consequences for functions customers, since they often set LinuxFxVersion to blessed functions images urls. **Environment summary** **Additional context**
Author: divyagandhii
Assignees: -
Labels: `Service Attention`, `Web Apps`, `needs-triage`
Milestone: -
yonzhan commented 3 years ago

webapp

divyagandhisethi commented 3 years ago

Since this is a functions specific scenario, it would be preferable if we only limit this change to scope of 'az functionapp config'. For example, running this command for an existing function app should not change any app settings -

az functionapp config set -g -n --subscription --linux-fx-version "DOCKER|mcr.microsoft.com/azure-functions/node:3.0.14916-node12-appservice"

The behaviour in az webapp config can remain untouched, since this is more of a functions app specific scenario.

Stolz commented 3 years ago

Same problem here. Both of the commands that allow to change the Docker image of a web app have the same behavior

az webapp config container set \
--resource-group $GROUP \
--name $APP \
--docker-custom-image-name 'example.azurecr.io/foo/bar:latest'
az webapp config set \
--resource-group $GROUP \
--name $APP \
--linux-fx-version "DOCKER|example.azurecr.io/foo/bar:latest"

A few weeks ago only the first command had that behavior but now it has also started to happen with the second one too

pragnagopa commented 3 years ago

cc @AnatoliB @gzuber - Can you please prioritize fixing this for function apps?

pragnagopa commented 3 years ago

For function apps do not add WEBSITES_ENABLE_APP_SERVICE_STORAGE if • LinuxFxVersion follows format : runtime|version • LinuxFxVersion follow format of blessed image

@divyagandhii - please provide format used for Functions blessed images.