Skip to content

When and Why should I set WEBSITE_ENABLE_APP_SERVICE_STORAGE

Bala G edited this page Feb 10, 2021 · 1 revision

Functions running on Linux dedicated (App Service Plan) or Linux Elastic Premium SKU are always container based. The exact image to be used by the function app is controlled by the SiteConfig entry named LinuxFxVersion. Following configurations are possible

  1. Function app uses one of the latest images published by Functions team. This is the most common configuration. LinuxFxVersion in this case will be of the format Node|12 or Python|3.7

  2. Function app uses a blessed image but pinned to a specific functions host version. When running in this mode, the function app will not receive the latest updates in functions runtime. So this is only recommended as a temporary measure in case there are issues with the most recent published image. Ex: LinuxFxVersion = DOCKER|mcr.microsoft.com/azure-functions/dotnet:3.0.15185-appservice

  3. Function app uses a custom image (usually based off one of the published function images).

    a) The custom image includes the functions code as part of the image.

    b) The custom image doesn't include the functions code as part of the image. One reason to do this is to install an OS dependency that doesnt exist in the published image.

The expectation in the case of apps using (1), (2) or (3b) is to deploy the functions separately after the app is created (usually using ZipDeploy / Functions Core tools). WEBSITE_ENABLE_APP_SERVICE_STORAGE controls where the app contents are stored in this case.

If WEBSITE_ENABLE_APP_SERVICE_STORAGE == true (or if this setting is not set at all), Functions platform will mount a shared persistent managed storage location at $HOME which is where all the functions content will be stored. $HOME will no longer point to a path inside the container. All instances of the function app will share the same storage location. Function apps using (1) or (2) or (3b) should use this configuration since any writes to local container file system will be discarded when a new function instance starts up.

If WEBSITE_ENABLE_APP_SERVICE_STORAGE == false. No shared storage will be mounted at $HOME. So each container will get its own copy of $HOME based on what is available inside the container. This configuration is usually used by function apps using (3a) since these apps do not need a shared persistent storage location.