Problem with running a web app for container for multiple containers

%3CLINGO-SUB%20id%3D%22lingo-sub-2034454%22%20slang%3D%22en-US%22%3EProblem%20with%20running%20a%20web%20app%20for%20container%20for%20multiple%20containers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2034454%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20create%20a%20web%20app%20(for%20containers)%20for%20my%20Django%20application%20which%20uses%20PostGreSql%20as%20its%20database.%26nbsp%3B%20I%20have%20my%20own%20Azure%20Registry%20where%20I%20pushed%20my%20images.%20The%20configuration%20for%20the%20web%20app%20is%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22melismirza_0-1609881436464.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F244404i0B8091DEBE776E5F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22melismirza_0-1609881436464.png%22%20alt%3D%22melismirza_0-1609881436464.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20the%20configuration%20file%20is%3A%3C%2FP%3E%3CP%3E-----------------------------------------------------------------------------------------------------------%3C%2FP%3E%3CP%3Eversion%3A%20'3.7'%3C%2FP%3E%3CP%3Eservices%3A%3CBR%20%2F%3Edb%3A%3CBR%20%2F%3Eimage%3A%20postgres%3Alatest%3CBR%20%2F%3Eenvironment%3A%3CBR%20%2F%3E-%20%22POSTGRES_HOST_AUTH_METHOD%3Dtrust%22%3CBR%20%2F%3Evolumes%3A%3CBR%20%2F%3E-%20postgres_data%3A%2Fvar%2Flib%2Fpostgresql%2Fdata%2F%3CBR%20%2F%3Eweb%3A%3CBR%20%2F%3Eimage%3A%20%22covittertest%3Alatest%22%3CBR%20%2F%3Ecommand%3A%20bash%20-c%20%22python%20manage.py%20makemigrations%20%26amp%3B%26amp%3B%20python%20manage.py%20migrate%20%26amp%3B%26amp%3B%20python%20manage.py%20runserver%200.0.0.0%3A8000%22%3CBR%20%2F%3Econtainer_name%3A%20covid1%3CBR%20%2F%3Evolumes%3A%3CBR%20%2F%3E-%20.%3A%2Fcode%3CBR%20%2F%3Eports%3A%3CBR%20%2F%3E-%20%228000%3A8000%22%3CBR%20%2F%3Edepends_on%3A%3CBR%20%2F%3E-%20db%3CBR%20%2F%3Evolumes%3A%3CBR%20%2F%3Epostgres_data%3A%3C%2FP%3E%3CP%3E-----------------------------------------------------------------------------------------%3C%2FP%3E%3CP%3EBoth%20of%20these%20images%20are%20present%20at%20the%20azure%20container%20registry.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20works%20correctly%20on%20my%20local%20machine%20with%20%22docker%20compose%20up%22%20command%20but%20the%20web%20app%20does%20not%20start%20on%20Azure.%20The%20error%20log%20is%3A%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%3CSTRONG%3EError%20message%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CDIV%20class%3D%22ng-star-inserted%22%3EUnrecognized%20volume%20name%20found%3A%20.%3C%2FDIV%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3CSTRONG%3EObservation%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CDIV%20class%3D%22ng-star-inserted%22%3EThis%20error%20happens%20when%20a%20volumes%20or%20volumeMounts%20section%20has%20a%20wrong%20name.%20Check%20the%20suggestions%20below%20to%20fix.%3C%2FDIV%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%3CSTRONG%3ESuggestion%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%3E%3CDIV%20class%3D%22ng-star-inserted%22%3EMake%20sure%20the%20volume%20name%20is%20correct%20in%20both%20container%20sections%20and%20the%20volume%20section.%3C%2FDIV%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20an%20additional%20configuration%20I%20have%20to%20make%20or%20are%20there%20any%20known%20bugs%20on%20this%20issue%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2034454%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWeb%20Apps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2039401%22%20slang%3D%22en-US%22%3ERe%3A%20Problem%20with%20running%20a%20web%20app%20for%20container%20for%20multiple%20containers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2039401%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F919045%22%20target%3D%22_blank%22%3E%40melismirza%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20i'm%20wondering%20if%20it%20is%20not%20because%20of%20this%20%3A%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%26nbsp%3B%3C%2FSPAN%3Evolumes%3CSPAN%3E%26nbsp%3Boption%20maps%20the%20file%20system%20to%20a%20directory%20within%20the%20container.%26nbsp%3B%3C%2FSPAN%3E%24%7BWEBAPP_STORAGE_HOME%7D%3CSPAN%3E%26nbsp%3Bis%20an%20environment%20variable%20in%20App%20Service%20that%20is%20mapped%20to%20persistent%20storage%20for%20your%20app%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ECan%20you%20have%20a%20look%20on%20this%20page%20to%20be%20sure%20you%20have%20the%20valid%20volume%20mount%20declaration%20%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Ftutorial-multi-container-app%23modify-configuration-file%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ETutorial%3A%20Create%20a%20multi-container%20app%20-%20Azure%20App%20Service%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi,

I am trying to create a web app (for containers) for my Django application which uses PostGreSql as its database.  I have my own Azure Registry where I pushed my images. The configuration for the web app is: 

melismirza_0-1609881436464.png

 

And the configuration file is:

-----------------------------------------------------------------------------------------------------------

version: '3.7'

services:
db:
image: postgres:latest
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
volumes:
- postgres_data:/var/lib/postgresql/data/
web:
image: "covittertest:latest"
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
container_name: covid1
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
volumes:
postgres_data:

-----------------------------------------------------------------------------------------

Both of these images are present at the azure container registry.

 

It works correctly on my local machine with "docker compose up" command but the web app does not start on Azure. The error log is:

Error message
Unrecognized volume name found: .
Observation
This error happens when a volumes or volumeMounts section has a wrong name. Check the suggestions below to fix.
Suggestion
Make sure the volume name is correct in both container sections and the volume section.

 

Is there an additional configuration I have to make or are there any known bugs on this issue?

 

Thanks.

1 Reply

@melismirza 

 

Hi i'm wondering if it is not because of this :  

The volumes option maps the file system to a directory within the container. ${WEBAPP_STORAGE_HOME} is an environment variable in App Service that is mapped to persistent storage for your app

Can you have a look on this page to be sure you have the valid volume mount declaration ? 

Tutorial: Create a multi-container app - Azure App Service | Microsoft Docs