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

标签 python azure azure-devops azure-pipelines azure-artifacts

我正在构建一个 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/

相关文章:

python - 如何在Python click模块生成的使用消息末尾添加多个空行?

Python 部署到 Azure 应用服务失败且没有错误

Azure CDN 将图像转换为 webp

postgresql - Azure PostgreSQL 即服务延迟问题

continuous-integration - 如何将 VSTS 生成的构建版本关联到 VS App Center 中的发布?

visual-studio - 是否有提供存储库根目录的 MSBuild 属性?

azure-devops - 如何在 Azure DevOps 中限制对 Pipelines 的访问

python - 如何提高拆分列表的速度?

python - 在 Daphne - SSL 上使用 channel 部署 django 应用程序

python - Pandas :重新采样后计算唯一值