HTTP pings on port: 8000 failing site start

utsav jivani 6 Reputation points
2022-02-14T03:04:28.63+00:00

I'm trying to deploy a web app on python using vscode deploy. I'm getting errors for "didn't respond to HTTP pings on port: 8000". I'm not using any docker file command for deployment. I tried the "WEBSITE_PORT" value as 3000 in the configuration of this website. The container is probably expecting some other port, but I don't know how to change the port of the container.

173889-image.png
173888-error.jpg.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,665 questions
{count} vote

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 21,346 Reputation points
    2022-02-14T11:12:30.767+00:00

    Thanks for asking question! If the container couldn't start or exited, The application maybe facing a generic error: While importing 'app', an ImportError was raised. which is causing your app to fail proper startup.

    Click https://udatapythonapi.scm.azurewesites.net/api/logs/docker words to access your logs and review them by opening the files with the default_docker.log.
    Or
    Click https://udatapythonapi.scm.azurewesites.net/api/logstream to access the LogStream

    As per findings: Your Application logs contain errors or warnings
    • swallow_exception
    • _exception
    • exception

    Please note that if have a Flask app whose main code file is named something other than app.py or application.py*, or the app object is named something other than app then you need a custom startup command.

    Please refer to this link https://learn.microsoft.com/en-us/azure/developer/python/tutorial-deploy-app-service-on-linux-04#flask-startup-commands

    Also, you may want to know that the App Service deployment engine automatically activates a virtual environment and runs pip install -r requirements.txt for you when you deploy a Git repository.

    Please ensure you’re using relative paths in all pre- and post-build scripts because the build container in which Oryx runs is different from the runtime container in which the app runs.

    Virtual environments are not portable, so a virtual environment should not be deployed with your application code. Also, you could let Oryx create a virtual environment and install your packages on the web app by creating an app setting, SCM_DO_BUILD_DURING_DEPLOYMENT, and setting it to 1.

    This will force Oryx to install your packages whenever you deploy to App Service.

    Please review the following article that might help you customize and configure your Web App to your requirements https://learn.microsoft.com/en-us/azure/app-service/containers/how-to-configure-python

    More details: Things You Should Know: Web Apps and Linux

    Let us know if further query.

    0 comments No comments

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.