Azure YAML 管道:如何在 Azure DevOps 中引用另一个项目中的项目和存储库

lea*_*ner 4 azure-devops azure-pipelines-yaml

我在一个组织 ABC 中,它有三个 Azure DevOps 项目,即 A、B 和 C。一切都在 Azure Repos 下,这意味着我们没有使用 GitHub。

我正在尝试在项目 C 中签出项目 A 和 B 的存储库。每个项目都将拥有自己的微服务,但共享平台服务将自动执行需要部署到 AKS 中的内容。

问题陈述:当我尝试从项目 C 中的项目 A 和 B 中签出存储库时,出现如下错误。片段如下:

resources:
  repositories:
    - repository: microservice-a
      type: git
      name: 'InPlaceCommunications/microservice-a'
      ref: master

    - repository: microservice-b
      type: git
      name: 'Project B/microservice-b'
      ref: master
Run Code Online (Sandbox Code Playgroud)

但是,我收到如下错误:

remote: TF401019: The Git repository with name or identifier microservice-a does not exist or you do not have permissions for the operation you are attempting.
Run Code Online (Sandbox Code Playgroud)

任何指导将不胜感激。

我确实注意到,我拥有自己克隆存储库的完全权限,但这并没有发生在管道上。

Kev*_*SFT 8

远程:TF401019:名称或标识符为 microservice-a 的 Git 存储库不存在,或者您没有尝试执行的操作的权限。

根据错误信息,您需要检查以下两点:

  1. 检查“项目 C -> 项目设置 -> 设置”中的“将非发布管道的作业授权范围限制为当前项目”选项是否已禁用。您需要禁用此选项。

在此输入图像描述

  1. 检查服务帐户:Project Collection Build Service (OrganizationName)是否具有Project A/B -> Project Settings -> Repositories -> Target repos -> Security中的读取权限。

在此输入图像描述

  • 我弄清楚是什么问题了。与您提出的解决方案无关。一名团队成员删除了 Azure DevOps 项目中的空间,因此我收到错误! (2认同)