Reputation: 3299
I'm trying to set a build pipeline to run on a specific agent pool. At the moment it insists on working on the "Azure Pipelines" pool:
However I'm not able to change the build pipeline's agent pool (at least I'm not sure how).
My YAML looks like this:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'select'
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Pack the package'
inputs:
command: 'pack'
configuration: 'Release'
packagesToPack: 'NugetComponents/**/*.csproj'
nobuild: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
I'm not sure if I need to change anything here. I can't find anything in the interface for configuring which agent bool a pipeline should use?
Upvotes: 7
Views: 21092
Reputation: 35544
According to this doc about agent pools, the “Azure Pipelines” pool contains various Windows, Linux , and macOS images.
The Azure Pipelines hosted pool replaces the previous hosted pools that had names that mapped to the corresponding images. Any jobs you had in the previous hosted pools are automatically redirected to the correct image in the new Azure Pipelines hosted pool.
So when you specify Microsoft-hosted agent ( e.g. Ubuntu-latest) , the pipeline will run on the “Azure Pipelines” pool.
Update
You can specify the target agent pool in the “pool” field.
This is the format of Yaml:
pool:
name: string
demands: string
vmImage: string
For Microsoft-hosted agents: you can directly specify “vmImage”.
For example:
pool:
vmImage: 'ubuntu-16.04'
For Self-hosted agents: you can specify agent pool name.
For example:
pool:
name: Agent Pool name
Here is a doc about specifying agent pool in Yaml.
Upvotes: 12