azure-devopsazure-pipelines-yaml

Azure YAML Pipelines: How to refer a project and repo in another project in Azure DevOps


I am in an Organization ABC, It has three Azure DevOps projects, namely A, B, and C. Everything is under Azure Repos that means we are not using GitHub.

I am trying to perform a checkout in Project C the repos from project A and B. Every project will have its ow microservices but Shared Platform Services will automate what needs to be deployed into AKS.

Problem Statement: I get error like below when I am trying to checkout repos from projects A and B in Project C. Snippet is as below:

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

However, I get error as below:

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.

I do note that I have full permissions to clone the repo myself it is just not happening on the Pipeline.


Solution

  • 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.

    Based on the error message, you need to check the following two points:

    1. Check if the option Limit job authorization scope to current project for non-release pipelines is disable in Project C -> Project Settings -> Settings. You need to disable this option.

    enter image description here

    1. Check if the Service Account: Project Collection Build Service (OrganizationName) has the Read Permission in Project A/B -> Project Settings -> Repositories -> Target repos -> Security.

    enter image description here