7

I've deployed a Web App on Azure and use a Docker Container from the public registry (my own image) to host my website. But users can upload pictures and data is stored in json-files on the server. Of course I want to write these files to a mounted volume outside of the container. So that I can redeploy an update version of my website without losing data.

Is that possible with Web Apps? Or do I need to move on to an Ubuntu VM with Docker on Azure? What I like about the webapps is I don't have to worry about managing the VM and only care about my container.

riezebosch
  • 1,796
  • 15
  • 28

1 Answers1

8

This blog post is a great start and understanding Azure's strategy regarding volume mounting (ASL == App Services on Linux; ASW=App Services on Windows):

... However, in this case, we would like to leverage the regular App Service Filesystem, so we can interact with the application using FTP. When a container is deployed, ASL mounts the equivalent of D:\home path on ASW to /home (using volume mount in Docker). Now when that happens, it is up to your container to map the corresponding paths into the application. In order to understand how this works more closely, take a look at the official Dockerfile used in PHP7 container on ASL.

https://hajekj.net/2016/12/25/building-custom-docker-images-for-use-in-app-service-on-linux/

Randy Larson
  • 4,939
  • 2
  • 15
  • 13
  • @riezebosch, did you have any success seeing files in your containers /home directory appear in the Azure filesystem? Looking in Kudu, I don't see my files appearing there. I have a related question here: https://stackoverflow.com/questions/49212556/how-to-mount-azure-app-service-storage-in-jenkins-docker-container – anschoewe Mar 14 '18 at 14:11
  • Didn't look further into it. – riezebosch Mar 16 '18 at 18:24
  • Do you know of an artile with the same information but for windows? – Juan Jan 24 '20 at 15:18