For future readers, this may be related to how the pipeline is setup. If you edit your pipeline from the portal, use the context menu and to to Triggers
, there will be an error on the YAML tab for Default agent pool for YAML
.
This happened to me as I was automating setup of pipelines via the API, instead of using the portal, so the pool was not set. The fix for me was to set a queue pool in the create payload. The portal should set this for you.
It seems the "classic" pipelines stuck around and yaml doesnt get interpreted as expected if you do not use the official way.
Here is the request to the ADO API:
await buildAPI.createDefinition(
{
name,
path: folderPath,
type: DefinitionType.Build,
queueStatus: DefinitionQueueStatus.Enabled,
process: {
type: 2,
yamlFilename: filename,
} as YamlProcess,
project: { id: this.project!.id },
queue: { pool: { name: "Azure Pipelines" } },
repository: {
id: this.repo!.id,
type: "TfsGit",
},
triggers: [
{
triggerType: DefinitionTriggerType.ContinuousIntegration,
branchFilters: ["master"],
maxConcurrentBuildsPerBranch: 1,
settingsSourceType: 2, // Not sure what this is
} as ContinuousIntegrationTrigger,
],
},
this.project!.id
);