Apologize for the inconvenience and frustration with this issue. If I have understood right you are following below article.
Tutorial: Deploy a Django web app with PostgreSQL in Azure App Service If so, Thanks for sharing feedback with us. I will internally connect to our content team for more clear documentation on this.
As you mentioned “I need to run two commands after every deployment. The first one is python manage.py migrate and the second one is python manage.py process_tasks &, note that the last one must run in background because it has to keep running.”
For Django-background-tasks, you will need to run python manage.py process_tasks and for Linux App Services here are some documents you want to investigate:
- Configure a custom Linux container for Azure App Service
- Configure a custom startup file for Python apps on Azure App Service
Looking to the log:
2020-09-08T21:08:48.929Z ERROR - Container q7-api-dev_0_1777f900 for site q7-api-dev did not start within expected time limit. Elapsed time = 230.4407077 sec
2020-09-08T21:08:48.959Z ERROR - Container q7-api-dev_0_1777f900 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
2020-09-08T21:08:49.699Z INFO - Stopping site q7-api-dev because it failed during startup.
To elaborate on this when we start your container, we'll wait a while for it to start and initialize. We consider the startup to be successful once the container is running and once we get a response to a ping so that we know it's ready to respond to HTTP traffic. We'll wait 230 seconds for that to happen. If we don't have a successful start within 230 seconds, we'll assume there's a problem and we'll stop the container.
You can add an app setting called WEBSITES_CONTAINER_START_TIME_LIMIT and set it to the number of seconds you would like for us to wait for your container to start (up to a maximum of 1800).
Also, check container is listening to your port, we will wait a certain amount of time for your container to start before we consider it be a failed start. In order for us to consider a container to be successfully started, the container must start and it must respond to an HTTP ping. If the container starts but does not respond to a ping, we will eventually log an event in the Docker log saying that it didn't start.
Could you please confirm that port 8000 is exposed, so that when trying to attempt to ping, the container is listening.
You may use the WEBSITES_PORT app setting with a value of "8000" to expose that port.
For details refer to Your container must respond to an HTTP ping
If your container takes a long time to start, increase the start time limit
For more details refer to Things You Should Know: Web Apps and Linux
Let us know if issue persists.