'Pipeline Resource * Input Must be Valid

I'm following pipeline resource triggers docs and I constructed my pipeline that looks like this.

15 resources:
16   pipelines:
17     - pipeline: buildPipeline
18       source: template-ci # azure devops pipeline name (defined in ADO UI!)
19       project: $(System.TeamProject) # azure devops project name
20       trigger:
21         branches:
22           include:
23           - main

Unfortunately, the above definition throws this error /devops/ct.yml (Line: 17, Col: 17): Pipeline Resource buildPipeline Input Must be Valid.

When I look at line 17 - pipeline: buildPipeline it looks perfectly fine what I'm doing wrong?



Solution 1:[1]

Context

Turns out that the error is not referring to a single line (17) of configuration but, to the resource definition (pipeline resource) that, in my case, is defined from line 17 to 23.

Problem

My pipeline problem lies on the line number 19. Apparently, Azure Pipelines don't like runtime expression project: $(System.TeamProject) for pipeline resource definition.

Solutions

  1. Removing line 19 fixed the problem.
  2. Replace $(System.TeamProject) with the project name specified in azure devops. e.g for this url https://dev.azure.com/your-org-name/Your Project Name the project name would be Your Project Name. Resulting with yaml config that looks like below.
19       project: Your Project Nam

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lukasz Dynowski