gpt4 book ai didi

python - azure 管道中的 pip install azure-functions 因 pip 验证任务而失败

转载 作者:行者123 更新时间:2023-12-03 07:07:53 33 4
gpt4 key购买 nike

我正在构建一个 CI/CD azure 管道,以构建并将 azure 函数从 DevOps 存储库发布到 Azure。相关函数使用作为 Python 包 Artifact 存储在组织范围的 feed 中的自定义 SDK。

如果我使用 pip 身份验证任务来访问 SDK,该任务会通过,但管道会在安装 requests.txt 时崩溃。奇怪的是,在我们使用 SDK 之前,安装 azure-functions 包时出现错误。如果我删除 SDK 要求和 pip 身份验证任务,则不会发生此错误。因此,有关身份验证任务的某些内容意味着代理无法访问 azure-functions。

error message

此外,如果我交换 requierments.txt 中“azure-functions”和“CustomSDK”的顺序,代理仍然无法安装 SDK 工件,因此身份验证任务一定有问题:

steps:
- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: <organisation-scoped-feed>
pythonDownloadServiceConnections: <service-connection-to-SDK-URL>

为什么我无法下载这些软件包?

最佳答案

这是由于额外索引 URL 引起的困惑。为了访问 PyPI 和工件提要,需要设置以下设置:

- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
pythonDownloadServiceConnections: <service-connection-to-SDK-Feed>
onlyAddExtraIndex: true

这样 pip 将首先引用 PyPI,然后再引用工件提要。

关于python - azure 管道中的 pip install azure-functions 因 pip 验证任务而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71079392/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com