I had built a FastAPI Azure webapp and used your idea of passing "gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app" in startup command, but I keep getting the following error.
Error: class uri 'uvicorn.workers.UvicornWorker' invalid or not found:
2021-01-06T04:40:40.709590602Z
2021-01-06T04:40:40.709594402Z [Traceback (most recent call last):
2021-01-06T04:40:40.709598102Z File "/opt/python/3.7.9/lib/python3.7/site-packages/gunicorn/util.py", line 99, in load_class
2021-01-06T04:40:40.709602202Z mod = importlib.import_module('.'.join(components))
2021-01-06T04:40:40.709605802Z File "/opt/python/3.7.9/lib/python3.7/importlib/init.py", line 127, in import_module
2021-01-06T04:40:40.709609603Z return _bootstrap._gcd_import(name[level:], package, level)
2021-01-06T04:40:40.709613203Z File "", line 1006, in _gcd_import
2021-01-06T04:40:40.709617203Z File "", line 983, in _find_and_load
2021-01-06T04:40:40.709629603Z File "", line 953, in _find_and_load_unlocked
2021-01-06T04:40:40.709633503Z File "", line 219, in _call_with_frames_removed
2021-01-06T04:40:40.709637103Z File "", line 1006, in _gcd_import
2021-01-06T04:40:40.709640903Z File "", line 983, in _find_and_load
2021-01-06T04:40:40.709644503Z File "", line 965, in _find_and_load_unlocked
2021-01-06T04:40:40.709648303Z ModuleNotFoundError: No module named 'uvicorn'
I have a "requirements.txt" file like you have in your project and have included both gunicorn and unicorn libraries, but for some reason the I feel the webapp doesn't pick the gunicorn instance from the virtual environment. Have you faced anything like this?