How to mount Volumes on Azure Web App for Containers and access them ?

Krushna Dash
3 min readMay 10, 2020

Docker containers by default supported Volumes that are the preferred mechanism for persisting data generated by and used by Docker containers.

To map a volume on Azure Web App for Containers there are two possible ways

  1. Persistent Shared Storage
  2. Using an Azure storage

Persistent Share Storage is enabled by default, you can find more details from here. As per the Microsoft documentation You can use the /home directory in your app’s file system to persist files across restarts and share them across instances. The /home in your app is provided to enable your container app to access persistent storage.

Using an Azure storage : This is in preview mode you can find more details from here

How to enable Persistent Share Storage and use it?
Although the documentation says it is enabled by default but it is not and the documentation does not have any clear instruction on how to access the Persistent Share Storage outside of your application. Here I will cover detailed instructions on how to enable it and access it outside of your app service.

Once you created an Azure web app for the container you can use the below command to enable the Persistent Share Storage using Azure CLI.

az webapp config appsettings set --resource-group <resource-group-name> --name <app-name> --settings WEBSITES_ENABLE_APP_SERVICE_STORAGE=true

How to access the Persistent shared storage outside of your application?
You can access the Persistent shared storage using FTP or FTPS using any FTP client.

Go to your Azure web app console and add a deployment user by navigating to Home>app service> <app name> Deployment Credentials like the below screen.

Once you add a user you can go to Home>app service> <app name> properties and find the copy the FTP/deployment user and FTPS host name to connect to Persistent shared storage using FTP or FTPS, example screen below.

You can use FileZilla to configure the FTPS connection and list the directories like below

File listings

Here the Test.txt and Test2.txt are the files create by my app and it is stored to persistent storage.

--

--