Tag Archives: Azure DevOps

Azure DevOps pipeline unable to checkout external repo – remote: TF401019: The Git repository with name or identifier does not exist

Assume the following scenario you trying to run Azure DevOps pipeline from one Azure DevOps repo and it relies on some contents in another Azure DevOps repo which specified in resources section of your YAML pipeline (for example it can be a repo which stores your master templates). You absolutely sure that your resources section is right and that it contains correct values for repository type and name as you were reusing this configuration in some other pipelines in other projects. For example, your pipeline resources section may look as follows:

Sample resources section

Nonetheless your YAML pipeline stored in your new Azure DevOps repository keeps failing with the following error:

remote: TF401019: The Git repository with name or identifier CORRECT_REPOSITORY_NAME does not exist or you do not have permissions for the operation you are attempting.

Here is a sample error message screenshot from pipeline job history:

Failing pipeline checkout stage

So the problem here (as we are sure that resource section repository config is OK) is configuration of a DevOps project which contains failing pipeline. To resolve this you will need to disable the following project settings:

  • Limit job authorization scope to current project for non-release pipelines
  • Limit job authorization scope to referenced Azure DevOps repositories
Azure DevOps project authorization scope settings

Once these setting changed you should be able to re-run pipeline to make sure that it no longer fails due to TF401019 error.

Validating Azure DevOps YAML pipeline locally

Today my colleague asked me how to validate Azure pipeline without committing changes to repo and trying to run pipeline. There is a VS Code Azure Pipelines YAML Validator plugin, but it does not work for YAML files which reference template files. In this scenario (validation of YAML files which reference template files) you can perform local validation using VSTeam PowerShell module, see details on using this approach below.

Output of Test-VSTeamYamlPipeline returns Name / URL / state / Id and state = unknown with Id = -1 means that no validation errors were found:

If validation errors will be found it will return error text with validation error details – you will see the same errors as if you would try to run this pipeline – such things as missing required parameter(s) or unknown parameter(s) will be reported.