I've also tried the same config w/o any volumes defined, and I noticed that data does not survive reboots, which is what I would expect. I guess the strange thing I'm trying to figure out is...where is this data? Perhaps I don't need to explicitly say anything about azure_file and just mention volumes generally and it works? This is pretty underdocumented behavior so I wanted to understand what I can rely on and what I can't.
I'm using Basic B1 tier app service plan.
Hi @Derek ,
I'm thinking you're using https://github.com/Azure/azurefile-dockervolumedriver. You want to look for a storage account that contains a file share that matches storage_account_name and share_name respectively. Using your simple config, you can run:
az storage share-rm show --name shareName --storage-account storageName --resource-group the-app-resource-group
From the CLI. Also be aware that this driver is longer supported. However, you can still link your container your app to storage (in preview). In this example,
version: "3.7"
services:
image: xxx.azurecr.io/n8nio/n8n:0.113.0
restart: always
volumes:
- n8n-data:/n8n/data
The name of the storage mount would be n8n-data and the mount path the folder insider your container i.e. /n8n/data.
Regards,
Hi @Ryan Hill ,
Thank you for posting this, I was having the same exact experience as @Derek using the legacy driver: azure_file in my docker compose file.
I did try what you suggested, and while I do now have an Azure Mount Point defined in my App Service as /data, now when I try starting my container, I get his error:
2021-10-31T17:37:36.430Z ERROR - multi-container unit was not started successfully
2021-10-31T17:37:36.434Z INFO - Container logs from banrai_app_0_5c6be327 = 2021-10-31T17:37:21.757620974Z python3: can't open file '/data/app.py': [Errno 2] No such file or directory
2021-10-31T17:37:26.639026165Z python3: can't open file '/data/app.py': [Errno 2] No such file or directory
And sure enough, when I look inside my storage account, I do not see any reference to /data.
Do I need to create something called /data there first?
CMD ["python3", "app.py"]
That worked just fine with the legacy azure_drive settings in the docker compose yaml (and just like @Derek I noticed the volume survived restarts of the app service), but it seems incompatible with defining the azure storage mount explicitly, even when I do that first, before attempting to start the app service
If you want /data to be persisted to your storage account, I would separate your code and data directories e.g.
WORKDIR /src
This avoids having your code files to be persisted along with your data. Then create a /data folder under /src and update your mount path in the Azure portal to /src/data. Let me know if that helps.
From the CLI. Also be aware that this driver is longer supported. However, you can still link your container your app to storage (in preview)
This irritates me a little bit cause in this link it's described that azure storages are not supported for "Azure App Services w/ Docker Compose volume"
volumes (mapping to Azure Storage is unsupported)
So are azure storages working for azure web app with docker compose or aren't?
However, you can still link your container your app to storage (in preview). In this example
I'm a little bit confused cause in this link says that azure web app services with docker does not support azure storage:
Azure Storage is not supported with Docker Compose Scenarios
So is it working or not??