@Cary Hutchinson , Thanks for posting this question! Apologies for any inconvenience with this.
Just to confirm, are you leveraging Azure App Service WebApp or Azure Static WebApps?
Possible Causes:
Typically, the error occurs -Exception: ModuleNotFoundError: No module named 'module_name'." This error occurs when a Python function app fails to load a Python module.
ModuleNotFoundError
will usually present itself where the module/package you’re importing is missing. Either it was never defined in requirements.txt
, deployment was done but package installation was never done to produce site-packages
, or the library is there and the package installation was done - but it’s dependent on a native library (.so
files) that is not available in the container.
Ultimately, this will always cause the application/container to crash.
You may run the following command: pip install django
to Django modules / and pip install -r requirements.txt
To validate if you’re encountering this scenario, you can check with any of the below methods:
Note: Make sure App Service Logs are enabled first
- Log Stream
- Retrieving logs directly from the Kudu site, or directly view/download via an FTP client
- Diagnose and Solve Problems -> Application Logs detector, Container Crash detector, or Container Issues detector
- Try setting
ENABLE_ORYX_BUILD = true
in app settings - Additional info on the app setting document:
ENABLE_ORYX_BUILD - if true, use the Oryx build system instead of the legacy Kudu system Checkout this article/document for more info : Python on Linux App Service and ModuleNotFoundError - For customizing the deployment : Configure a Linux Python app for Azure App Service Kindly let us know how it goes, I'll follow-up with you further.