如何将Azure App Service中datalust/seq容器的/data映射到Web App的/home/data
Mapping datalust/seq's /data directory to Azure Web App's persistent /home/data
Great question! Since Azure Web App for Containers restricts direct use of docker run parameters like -v, we have two reliable ways to achieve this data persistence using application settings (environment variables), which aligns with your requirements:
Method 1: Use seq's built-in environment variable (Recommended)
datalust/seq natively supports configuring its storage path via an environment variable, which is the cleanest approach:
- Enable persistent storage: Add an app setting
WEBSITES_ENABLE_APP_SERVICE_STORAGEwith valuetrue. This mounts the Web App's/homedirectory to Azure Storage, ensuring data survives restarts/deployments. - Point seq to the persistent directory: Add another app setting
SEQ_STORAGE_PATHwith value/home/data. This tells seq to store all its data directly in the persistent/home/datadirectory (instead of the default/data).
No volume mapping is needed here—seq will write straight to the persistent location automatically.
Method 2: Pass volume mapping via Docker run arguments
If you prefer to stick with the traditional volume mapping approach (useful for containers that don't support path configuration via env vars):
- First enable persistent storage: Same as Method 1, set
WEBSITES_ENABLE_APP_SERVICE_STORAGE = true. - Add Docker run arguments: Create an app setting
DOCKER_RUN_ARGSwith value-v /home/data:/data. Azure Web App will append this parameter to the underlyingdocker runcommand when starting your seq container, creating the exact volume mapping you need.
Verification steps
After setting up either method:
- Restart your Web App to apply the new settings.
- Use the Kudu console (accessible via
https://<your-app-name>.scm.azurewebsites.net) to:- Check the
/home/datadirectory on the Web App host—you should see seq's data files here. - Or, access the container's shell via Kudu's "Container console" and verify the
/data(Method 2) or/home/data(Method 1) directory contains your seq data.
- Check the
- Restart the Web App again and confirm the data is still present to ensure persistence works.
内容的提问来源于stack exchange,提问作者Cpt Slow
相关产品推荐
相关产品推荐

