Azure App Services w/ Docker Compose volume persistence question

Derek 41 Reputation points
2021-04-03T19:23:35.167+00:00

I am trying to understand how persistence is managed with App Services when using Docker Compose.

Here's my simple config:

version: "3.7"
services:
  n8n:
    image: xxx.azurecr.io/n8nio/n8n:0.113.0
    restart: always
    volumes:
      - n8n-data:/n8n/data

volumes:
  n8n-data:
    driver: azure_file
    driver_opts:
      share_name: shareName
      storage_account_name: storageName

I've observed the following:

  1. It boots up, and I can write to disk (sqlite).
  2. Data survives a reboot and stop/start of my app.
  3. If I go looking for my the contents of my share name, I do not see any data being written to it (where is the data being written?)

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.

Azure App Services
Azure App Services
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,331 questions
No comments
{count} votes

Accepted answer
  1. Ryan Hill 16,241 Reputation points Microsoft Employee
    2021-04-05T14:26:57.91+00:00

    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:  
      n8n:  
        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.

    84380-image.png

    Regards,
    Ryan


0 additional answers

Sort by: Most helpful