4

I am working on dockrized app which is deployed in azure with app service "webApp for containers"

i am trying to link a blob storage account to my app i already created storage account and linked it to the my app at "path mappings" tab.

but i keep getting error saying :
 Exception in multi-container config parsing: (Line: 13, Col: 15, Idx: 336) - (Line: 13, Col: 37, Idx: 358): Bind mount must start with ${WEBAPP_STORAGE_HOME}.

i want to use my own volume, i dont want to bind it to local host storage.

what am i doing wrong?

below is the configuration and the error of the compose file, i even removed all the other services just to make sure that there are no unexpected problems

version: '2'
services:     
    app:
        container_name: almaz-backend
        image: 'almazyregistry.azurecr.io/test/alamzo:latest'
        restart: always
        build: .
        ports:
            - '3000:3000'        
        environment:
            - NODE_ENV=production        
        volumes:               
            - AppDataMount/logs:/logs    
            - AppDataMount/public:/public

volumes:
 AppDataMount:   
2019-12-01 19:42:52.559 ERROR - Exception in multi-container config parsing: (Line: 13, Col: 15, Idx: 336) - (Line: 13, Col: 37, Idx: 358): Bind mount must start with ${WEBAPP_STORAGE_HOME}.

1 Answers1

2

Actually, what you had set to mount the volumes does not meet the rules in Azure Web App For Container. If you want to use the docker-compose file, it should be like this:

version: '3'
services:     
    app:
        container_name: almaz-backend
        image: 'almazyregistry.azurecr.io/test/alamzo:latest'
        restart: always
        build: .
        ports:
            - '3000:3000'        
        environment:
            - NODE_ENV=production        
        volumes:               
        - <custom-id1>:/logs/
        - <custom-id2>:/public/

And each volume needs one container in the storage. So for you, it needs two containers. You can use the CLI command to set the custom id like this:

az webapp config storage-account add --resource-group <group_name> --name <app_name> --custom-id <custom_id> --storage-type AzureBlob --share-name <share_name> --account-name <storage_account_name> --access-key "<access_key>" --mount-path <mount_path_directory>

For more details, see Serve content from Azure Storage in App Service on Linux.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39