Reputation: 13640
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?
Upvotes: 17
Views: 9930
Reputation: 1189
Really helpful question with answers, the line from error could be misleading. So I started comparing characters and seems that I've used same character from language different from English. Т
and T
(They look the same but they are different).
Paying more attention to VS Code, now I see a suggestion for fixing the character:
Upvotes: 0
Reputation: 1545
I had to correct the branch name from main
to master
and it worked.
Also correct the project name on Azure, found in the link (https://dev.azure.com/xxx/ProjectName)
Upvotes: 0
Reputation: 152
I had the same error message but in my case the problem was that there were two pipelines with the name specified for the source parameter (template_ci
) in the example above. When I renamed one of them it worked.
Upvotes: 10
Reputation: 13640
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
.
My pipeline problem lies on the line number 19
. Apparently, Azure Pipelines don't like runtime expression project: $(System.TeamProject)
for pipeline resource definition.
19
fixed the problem.$(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
Upvotes: 9