Hi Javier,
Lets troubleshoot with few points below:
- By default, Azure App Service expects your container to listen on port 80. Since your Flask app is set to listen on port 8000, you'll need to configure the
WEBSITES_PORT
application setting. You can do this through Azure CLI with the following command:
Make sure to replaceaz webapp config appsettings set --resource-group <group-name> --name <app-name> --settings WEBSITES_PORT=8000
<group-name>
and<app-name>
with your actual resource group and app names. - The error message indicating "Operation was canceled" often points to issues with connectivity or resource limits. Since you're also having trouble with SSH access, check that the
sshd
service is indeed running properly in your container. If you can't access SSH, ensure your ENTRYPOINT script is correctly launchingsshd
before starting Gunicorn. Update ENTRYPOINT Script Ensure it ends with:/usr/sbin/sshd & exec gunicorn main:app -b 0.0.0.0:8000
- Ensure your Dockerfile correctly exposes port 8000. You might need an
EXPOSE 8000
line in your Dockerfile. - Since you mentioned the logs show your Flask app starts, but you are getting "connection refused" using curl through Kudu, ensure your Flask application is binding correctly to
0.0.0.0:8000
within the container. - Review the network settings and access restrictions to ensure that nothing is blocking requests to your container.
You may refer to the blog Things You Should Know: Web Apps and Linux for more details on this.
If you have any further assistant, do let me know.