3
votes

I'm trying to checkout a different repository in my pipeline.

These would be the full URLs, so both repositories live in the same Azure DevOps:

https://dev.azure.com/company/Services/_git/mylocal

https://dev.azure.com/company/OtherServices/_git/another

I am trying to execute this in my YAML located in Services/mylocal@develop :

steps:
- checkout: self
- checkout: git://OtherServices/another@develop

From what I understand this should be simple. I have full access to both repos. Nonetheless I am getting:

remote: TF401019: The Git repository with name or identifier another does not exist or you do not have permissions for the operation you are attempting.
fatal: repository 'https://dev.azure.com/company/OtherServices/_git/another' not found

I am not sure if this is even supported in Azure Pipelines. But if it is, then what am I doing wrong? Our DevOps guy says to try with a PAT, but how do you use a PAT in the checkout? I haven't found literature on this regard.

What other options do I have?

Thanks!

1

1 Answers

4
votes

I have reproduced your error message: enter image description here

Here is the solution:

In Project Services:

Go to Project Settings -> Pipelines/Settings -> General/"Limit job authorization scope to current project for non-release pipelines" or "Limit job authorization scope to current project for release pipelines".

Disable one of them according to the type of your pipeline.

If the ToggleButton is grey, please disable the organization-scoped options first:

Go to Organization settings -> Pipelines/Settings ->Disable General/"Limit job authorization scope to current project for non-release pipelines" or "Limit job authorization scope to current project for release pipelines".

After the above work is completed, you can run your pipeline again. Make sure the project, repository and branch names in the checkout are correct.