Issue:
I am trying to deploy my Flask/ FastAPI application that uses WebSockets to Azure App Service. The application runs fine locally, but when deploying to Azure, it fails to start with the error: chmod: cannot access ‘/home/site/wwwroot/startup.sh’: No such file or directory.
Project Structure:
My project repository on GitHub is structured as follows:
/my-app
├── .github
│ └── workflows
│ └── azure.yml
├── app.py
├── requirements.txt
├── folder
├── folder
├── haarcascadeclassifier
└── startup.sh
startup.sh
apt-get update
apt-get install -y libgl1-mesa-glx libglib2.0-0
gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 app:app
Azure Configuration:
App Service on Linux
Python 3.10
Startup Command:
chmod +x /home/site/wwwroot/startup.sh && /home/site/wwwroot/startup.sh
Logs:
From the Azure activity log:
2024-06-26T16:25:28.3624037Z Site's appCommandLine: 'chmod +x /home/site/wwwroot/startup.sh && /home/site/wwwroot/startup.sh' ... 2024-06-26T16:25:29.2838467Z chmod: cannot access '/home/site/wwwroot/startup.sh': No such file or directory 2024-06-26T16:25:29.182.052Z ERROR - Container videoemotion_0_e6593d58 for site videoemotion has exited, failing site start 2024-06-26T16:25:29.064Z ERROR - Container videoemotion_0_e6593d58 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
What I’ve Tried:
Verified that startup.sh is in the root directory of the GitHub repository.
Ensured the script is committed and pushed to the repository.
Checked the Azure Deployment Center and Log Stream for any additional errors.
Questions:
Why is the startup.sh script not being found during deployment?
How can I ensure the script is correctly recognized and executed by Azure App Service?
Any help or insights would be greatly appreciated!
Lokmane ZEREG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.