Firstly, just to highlight, App Service uses the Gunicorn web server by default. The Apps are run using the Gunicorn WSGI HTTP Server.
Are you leveraging a blessed image or custom container?
Do the webapp work fine as expected locally?
- You may try executing the command
pip install -r requirements.txt
separately in the App Service container to see if there are any errors or issues with the modules. - I understand you have mentioned that the requirements.txt file is in root directory. Please ensure that all the modules are listed correctly and are compatible with the version of python that is being used in the app service container.
- In your startup command, identify the WSGI callable.
`python -m uvicorn application:app --host 0.0.0.0`
(or example, the following command starts the uvicorn server, assuming that the WSGI callable is named app
and is found in application.py)
If the issue still persist, review Access diagnostic logs and deployment logs to fetch more info ( as outlined in this doc)
Additional info:
- Container startup process to understand how App Service attempts to run your app.
- (App Service) Other frameworks and web servers
- (Review sample) msdocs-python-fastapi-quickstart