How to specify a mount path with a dot in Azure Web app mount storage

Viewed 771

I'm building an Azure Web App using the Docker Compose option to setup a WordPress site. I have a SQL script to initialise the MySQL database which needs to be in the directory /docker-entrypoint-initdb.d/. I've uploaded the script to an Azure storage container but when I try to add a path mount to the web app with the Mount path set to /docker-entrypoint-initdb.d/ I get the error The parameter 'AzureStoragePropertyDictionary' has an invalid value. Details: Mount path contains invalid characters. Please review documentation for a list of valid mount path characters. Changing the Mount path to /docker-entrypoint-initdbd/ (without the dot) allows the path mount to be saved but of course the script is not run when the app starts.

This is my docker-compose.yml

version: '3.7'

services:   db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpressuser
      MYSQL_PASSWORD: wordpresspassword
      MYSQL_RANDOM_ROOT_PASSWORD: '1'
    volumes:
      - db_data:/var/lib/mysql
      - InitDb:/docker-entrypoint-initdb.d

  wordpress:
    depends_on:
      - db
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wordpressuser
      WORDPRESS_DB_PASSWORD: wordpresspassword
      WORDPRESS_DB_NAME: wordpress 
volumes:   
    db_data:

This is the CLI script I'm using to create the path mount in the web app

az webapp config storage-account add -g MyRG -n MyWA --custom-id InitDb --storage-type AzureFiles --account-name MySA --share-name MyShareName --access-key MyAccessKey --mount-path /docker-entrypoint-initdb.d/

Is there a way around this?

1 Answers

As I know, I'm afraid that you cannot achieve it. In Azure Web App, the mount path does not support the dot in the path and you can see the limitation in the portal:

enter image description here

For now, I recommend you create the image that copies the files you need when creating. Then use the image directly.

Related