I want to deploy a simple FastAPI onto an Azure app service, but I keep getting this error message.
This is my api.
from fastapi import FastAPI
app = FastAPI()
@app.get('/')
async def welcome():
return {'message':'Wecome to My website!'}
The api works just fine on my local machine. The command I use on my VS code terminal is "uvicorn main: app".
In order to deploy my app, I have startup.sh where there is only one command line:
gunicorn -w 2 -k uvicorn.workers.UvicornWorker main:app
I've set up the configuration of the app service:
The pricing tier is :
I don't see any probem in the pipeline:
Alernatively, I've tried with each of following lines of code in startup.sh:
python -m uvicorn main:app
gunicorn --bind=0.0.0.0 --timeout:600 main:app
But all failed. Help is much appreciated!