terraformazure-web-app-serviceazure-container-registryazure-filesstorage-file-share

Azure Container Registry App Service AzureFiles mounting


I have an application which is built by Dockerfile and deployed to the Container Registry Repository and I have an App Service in Azure Resource Group which run from this Azure Container Registry Repository (terraform script) like this:

DOCKER_REGISTRY_SERVER_URL      = "https://<NAME>.azurecr.io"

The problem is that I need to mount some data, e.g. /data directory more than 100 GB, like in Storage Account File Share AzureFiles (for read and write) but I cannot because I am using Docker container in App Service and I cannot mount data in container. Could I do it and how? If yes, could I do it through the terraform script or yaml?

I tried to mount it in File Share, but it mounted only in App Service path, not in Docker container


Solution

  • Have a look at Mount Azure Storage as a local share in App Service documentation. What's most important is that your mount path should match the directory inside your docker image. This video does a great job of how-to setup the feature.