Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
HI @Shaelin Murphy
Thank you for confirming—that really helps narrow things down.
Since SCM_DO_BUILD_DURING_DEPLOYMENT is already set to true and the startup command is configured, here are some other common reasons why you might still see the "No module named uvicorn" error:
- The WEBSITE_RUN_FROM_PACKAGE conflict happens frequently. This setting is commonly used for zip deployments and can stop the Oryx build from running, even if SCM_DO_BUILD_DURING_DEPLOYMENT is enabled. To resolve this, check Configuration > Application settings for WEBSITE_RUN_FROM_PACKAGE. If it's set to 1, remove it or change it to 0, then save and redeploy your code.
- Check that the Oryx build completed successfully. After redeploying, review the Log stream or Deployment logs for entries such as: Running pip install -r requirements.txt. If this step is missing or shows errors, the virtual environment (antenv) will not have uvicorn installed.
Running pip install -r requirements.txt - Please ensure that your deployment package does not include any local virtual environment folders such as .venv, venv, or antenv. Oryx will handle the creation and management of its own virtual environment.
- Please ensure that the requirements.txt file is located at the root of your deployed package and that it includes uvicorn—preferably uvicorn[standard], or uvicorn together with gunicorn.
reference:
https://azureossd.github.io/2022/11/24/Python-on-Linux-App-Service-and-ModuleNotFound-Errors/
https://learn.microsoft.com/en-us/azure/app-service/configure-language-python
If the answer is helpful, Please do click "Accept the answer” and Yes, this can be beneficial to other community members.
If you have any other questions, let me know in the "comments" and I would be happy to help you