You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
You can import modules in your function code using both explicit relative and absolute references. Based on the folder structure shown above, the following imports work from within the function file __app__\my_first_function\__init__.py:
from . importexample#(explicit relative)from ..shared_codeimportmy_first_helper_function#(explicit relative)from__app__importshared_code#(absolute)import__app__.shared_code#(absolute)
Hi, adding to the above solution by @snobu, if you want to use absolute import and have nested directories, you can add your packages / module directories into python system variables using import sys sys.path.append('path to package or module with azure function directory as the root directory')
The root directory is the directory containing the function.json file
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
How to import a custom python module file into azure function.
My python class needs to import my custom class. For instance
How can I upload/where to upload my mlutil.py file so that my import from mlutil class won't throw error in my azure function ?
The text was updated successfully, but these errors were encountered: