I have a created a local azure linux function and tested succesfully with func start
. After testing Azure Devops Pipe Line promote it to the Azure (Linux) Function. The deployment seems to be in order.
Looking in the monitoring during the testing of the Azure (Linux) function it returns the following error:
Result: Failure Exception: ModuleNotFoundError: No module named 'pyodbc'. Troubleshooting Guide: https://aka.ms/functions-modulenotfound Stack: File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 305, in _handle__function_load_request func = loader.load_function( File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 42, in call raise extend_exception_message(e, message) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 40, in call return func(*args, **kwargs) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py", line 85, in load_function mod = importlib.import_module(fullmodname) File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/site/wwwroot/get_nji_metadata/init.py", line 3, in from .Metadata import MetaData File "/home/site/wwwroot/get_nji_metadata/Metadata.py", line 2, in import pyodbc
Requirements.txt
astroid==2.4.2
azure-functions==1.2.1
certifi==2020.6.20
chardet==3.0.4
colorama==0.4.3
idna==2.9
isort==4.3.21
lazy-object-proxy==1.4.3
mccabe==0.6.1
pylint==2.5.3
pyodbc==4.0.30
requests==2.24.0
six==1.15.0
toml==0.10.1
urllib3==1.25.9
wrapt==1.12.1
Question
- Is there a way to solve this issue in the "Linux variant" . I already looked at the Linux Python Azure Function APP - pyodbc module not found despite being in requirements.txt and other modules working fine but don't understand the solution of this guy. Also looked at the Microsoft documentation.
- Do i solve this issue on the "Windows variant" for Azure Functions ?
Please help me?
Manny thanks Erik