部署时 Azure Functions 失败 运行
Azure Functions fails running when deployed
我是新来的,如果 post 不完整,请见谅。
我正在尝试在与 blob 交互的 azure 上部署一个 python 脚本。
该脚本在本地运行良好:我可以与我的存储帐户交互,上传和下载 blob...
但是当我在 azure 上部署我的函数时,它不会 运行。
日志显示不存在名为 azure.storage 的模块。
事实是,在我的电脑上我必须通过 pip 安装这个模块。
我应该在 azure web 上添加这个模块吗?
我该怎么办?
我正在开发 Visual Studio 代码,使用 python 3.6.5.
调用详细信息中列出的错误:
Result: Failure Exception: ModuleNotFoundError: No module named 'azure.storage'. Troubleshooting Guide: https://aka.ms/functions-modulenotfound Stack: File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", line 309, in _handle__function_load_request func_request.metadata.entry_point) File "/azure-functions-host/workers/python/3.7/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.7/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 40, in call return func(*args, **kwargs) File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/loader.py", line 85, in load_function mod = importlib.import_module(fullmodname) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/site/wwwroot/HttpTriggerTest/__init__.py", line 3, in <module> import HttpTriggerTest.dependance1 as dependance1 File "/home/site/wwwroot/HttpTriggerTest/__init__.py", line 4, in <module> import azure.storage.blob
希望有人能帮助我。
Sol 1 : 尝试将环境变量 FUNCTIONS_WORKER_RUNTIME 设置为 python
Sol 2: 尝试将 azure.storage 添加到您的 requirements.txt 文件
进一步参考Ref1, ,Ref3。
我是新来的,如果 post 不完整,请见谅。
我正在尝试在与 blob 交互的 azure 上部署一个 python 脚本。 该脚本在本地运行良好:我可以与我的存储帐户交互,上传和下载 blob... 但是当我在 azure 上部署我的函数时,它不会 运行。 日志显示不存在名为 azure.storage 的模块。
事实是,在我的电脑上我必须通过 pip 安装这个模块。
我应该在 azure web 上添加这个模块吗? 我该怎么办?
我正在开发 Visual Studio 代码,使用 python 3.6.5.
调用详细信息中列出的错误:
Result: Failure Exception: ModuleNotFoundError: No module named 'azure.storage'. Troubleshooting Guide: https://aka.ms/functions-modulenotfound Stack: File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", line 309, in _handle__function_load_request func_request.metadata.entry_point) File "/azure-functions-host/workers/python/3.7/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.7/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 40, in call return func(*args, **kwargs) File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/loader.py", line 85, in load_function mod = importlib.import_module(fullmodname) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/site/wwwroot/HttpTriggerTest/__init__.py", line 3, in <module> import HttpTriggerTest.dependance1 as dependance1 File "/home/site/wwwroot/HttpTriggerTest/__init__.py", line 4, in <module> import azure.storage.blob
希望有人能帮助我。
Sol 1 : 尝试将环境变量 FUNCTIONS_WORKER_RUNTIME 设置为 python
Sol 2: 尝试将 azure.storage 添加到您的 requirements.txt 文件
进一步参考Ref1,