How to mount a FileShare to a named volume in Azure App Service using Docker Compose?

Nandha Kumar RP 0 Reputation points
2024-03-26T16:29:19.63+00:00

Hello,
I am using a Docker Compose file (docker-compose.yml) to initiate a container within my Azure App Service environment. My objective is to store the data generated within this container by utilizing volumes and directing them to my Azure Storage Account.

For this I have configured a named Volume in my docker-compose.yml

User's image

And used - Path Mappings under Configurations to Mount this Volume to my Azure Storage Account.

User's image

With this Path mapping, I am able o see the data in my Azure Storage Account (FileShare). But upon restart of the App Service I see that the files mounted are not getting used by the App Service.

 

I Would like to understand the use of this Volumes in Docker Compose and Mounting (Path Mapping) in Azure App Service.
What happens when an App Service with named Volumes in Docker Compose restarts?

NOTE: When I try to run the docker-compose.yml locally, Things are working good.

 

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,203 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,993 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 17,741 Reputation points Microsoft Employee Moderator
    2024-03-26T23:39:32.5766667+00:00

    @Nandha Kumar RP Please note that Docker Compose is not supported for Bring Your Own Storage with Azure App Service.

    Limitations

    The limitations of custom-mounted storage include:

    • Storage firewall is supported only through service endpoints and private endpoints (when VNET integration is used).
    • FTP/FTPS access to custom-mounted storage isn't supported (use Azure Storage Explorer).
    • Storage account shared access keys are the only means of authentication that are supported; Entra ID and RBAC Roles are not supported.
    • Azure CLI, Azure PowerShell, and Azure SDK support is in preview.
    • Mapping / or /home to custom-mounted storage isn't supported.
    • Don't map the storage mount to /tmp or its subdirectories as this action may cause a timeout during app startup.
    • Azure Storage isn't supported with Docker Compose scenarios.
    • Storage mounts aren't included in backups. Be sure to follow best practices to back up the Azure Storage accounts.
    • NFS support is only available for App Service on Linux. NFS isn't supported for Windows code and Windows containers. The web app and storage account need to be configured on the same VNET for NFS. The storage account used for file share should have "Premium" performance tier and "Filestorage" as the Account Kind. Azure Key Vault is not applicable when using the NFS protocol.
    • With VNET integration on your app, the mounted drive uses an RFC1918 IP address and not an IP address from your VNET.

    Source:https://learn.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?tabs=basic%2Cportal&pivots=container-linux#limitations

    Let us know if you have any further questions or concerns by replying to this message.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.