It keeps showing error after the app has been succesfully deployed on the Azure App Service, has anyone experienced something similar to this?
I have tried ssh into it to confirm my files are intact and they are all right, was expecting the default index page I built for the application
- Here are the logs:
2024-03-02T16:09:02.869Z INFO – Initiating warmup request to container testlive_0_f3462e59 for site testlive
2024-03-02T16:09:22.131Z ERROR – Container testlive_0_f3462e59 for site testlive has exited, failing site start
2024-03-02T16:09:22.144Z ERROR – Container testlive_0_f3462e59 didn’t respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
2024-03-02T16:09:22.184Z INFO – Stopping site testlive because it failed during startup.
2
Answers
I have been able to sort it out, for my start gunicorn command I was writing gunicorn --bind=0.0.0.0 --timeout 600 --chdir /mysite mysite.wsgi instead of gunicorn --bind=0.0.0.0 --timeout 600 --chdir ./mysite mysite.wsgi
One '.' can change everything lol, thanks so much everyone for the help
I tried deploying a Django app to Azure App Service.
First, install the django using pip
Create your Django project:
Create a virtual environment for the app
Here, you need to create a requirements.txt file to list all the dependencies required for the project.
Install dependencies:
Run the app :
Ensure your
wsgi.py
correctly sets the DJANGO_SETTINGS_MODULE to ‘yourproject.settings’ and also ensure your project structure is consistent. Make sure your packages are up to date.manage.py
This is the content of my settings.py file
Local output :
I deployed the Django app to Azure App Service using the VS Code Azure Extension.
Here are the steps:
Select your Azure subscription.
Then, select your created web app.
Right-click on the web app; you can see the "Deploy to Web App" option.
The deployment to azure app service was successful.
To view the website in the browser, right-click on your Azure app service and select Browse Site.
To check the deployed files in azure
1.Open you’re Azure app service.
Search for Advanced Tools and click on it.
Afterward, click on Go.
4.Inside the wwwroot folder of the site, you can find your deployed files.
Here’s the output: