0

I'm new here, sorry if the post is incomplete.

I'm trying to deploy a python script on azure that interacts with blobs. The script works fine in local : i can interact with my storage account, upload & download blobs... But when I deploy my function on azure, it won't run. The logs says no module named azure.storage exists.

Thing is, on my computer i had to pip install this module.

Should i add this module on azure web ? How am I supposed to do such a thing ?

I'm developping on Visual Studio Code using python 3.6.5.

Error listed in the invocations Details :

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 

I hope someone can help me.

0

1 Answer 1

1

Sol 1 : try setting environment variable FUNCTIONS_WORKER_RUNTIME to python

Sol 2: try adding azure.storage to your requirements.txt file

For further refer Ref1, Ref2,Ref3.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you RithwikBojja-MT for your quick answer. I checked FUNCTIONS_WORKER_RUNTIME in the configuration but it was already 'python'. So i checked the requirements.txtin my visual studio code project : i didn't wrote the package so it wasn't deployed on azure. (The package i needed was azure-storage-blob if someone ask)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.