Why is my App Service for Linux container not responding on port 8000 and showing "Operation was canceled" in logs?

Javier 40 Reputation points
2025-05-09T20:29:36.45+00:00

I'm deploying a custom Python 3.11 container with Flask and Gunicorn to Azure App Service for Linux using GitHub Actions. The app binds to 0.0.0.0:8000 and works fine locally and in another Azure App Service instance. However, in this instance:

  • Requests result in error logs:
      System.IO.IOException: Unable to read data from the transport connection: Operation canceled. System.Net.Sockets.SocketException (125): Operation canceled
    
    SSH access fails with SSH CONN CLOSE in Azure Portal curl http://localhost:8000/ from Kudu returns connection refused No files visible under /home/site/wwwroot via Kudu shell My ENTRYPOINT script starts both sshd and gunicorn main:app -b 0.0.0.0:8000

App logs indicate the Flask app starts and runs, but requests don't get through. There are no disk or memory issues.

Ask: Can you help identify why the container is not responding on port 8000 despite Gunicorn starting, and why both HTTP and SSH access are failing?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,732 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.