-1

Is it possible to import a module into an azure function straight from another git azure repos?

Instead of having the folder structure proposed at https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python#folder-structure

 __app__
 | - my_first_function
 | | - __init__.py
 | | - function.json
 | | - example.py
 | - my_second_function
 | | - __init__.py
 | | - function.json
 | - shared_code
 | | - my_first_helper_function.py
 | | - my_second_helper_function.py
 | - host.json
 | - requirements.txt
 | - Dockerfile
 tests

and using something like

from ..shared_code import my_first_helper_function

to import a module, I would like to keep all shared_code in a separate git repository and import from there.

Liam
  • 27,717
  • 28
  • 128
  • 190
Vicky
  • 127
  • 1
  • 3
  • 9
  • Who said I downvoted. I edited your question as this a python question and not really anything to do with Azure. – Liam Nov 05 '20 at 13:38

1 Answers1

0

pip supports installing from version control which you can leverage directly. Note that your build system would require permission to the git repo if its private.

PramodValavala
  • 6,026
  • 1
  • 11
  • 30