【问题标题】:Azure function import module from azure repos来自 azure repos 的 Azure 函数导入模块
【发布时间】:2021-02-18 05:11:35
【问题描述】:

是否可以直接从另一个 git azure repos 将模块导入 azure 函数?

而不是 https://docs.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

并使用类似的东西

from ..shared_code import my_first_helper_function

要导入模块,我想将所有 shared_code 保存在单独的 git 存储库中并从那里导入。

【问题讨论】:

  • 谁说我投了反对票。我将您的问题编辑为 Python 问题,与 Azure 没有任何关系。

标签: python git azure-functions azure-repos


【解决方案1】:

pip 支持您可以直接利用的installing from version control。请注意,如果它是私有的,您的构建系统将需要对 git 存储库的权限。

【讨论】:

    猜你喜欢
    • 2019-11-14
    • 2020-08-20
    • 1970-01-01
    • 1970-01-01
    • 2020-01-21
    • 1970-01-01
    • 1970-01-01
    • 2020-03-20
    • 1970-01-01
    相关资源
    最近更新 更多