Technical questionAccepted answer
Assign specific agent on Azure DevOps YAML Pipelines
Dàniel Hernández
Jul 1
0 views1
I am trying to assign a specific agent on my agent pool but I don't know how to do it. Does anyone know it?
I tried with this but doesn't work:
- stage: Deploy
pool: alm-aws-pool
agent.name: deploy-05-agent1
1 answer
Accepted answer · original discussion
Kevin Lu
PermalinkJul 2
The pool name needs to be added to the name field, then you could add demands and check the agent name with the equals operator. You may try the following Yaml Code:
stages:
- stage: Deploy
pool:
name: <agent-pool-name>
demands:
- Agent.Name -equals <agent-name>
jobs:
- job: BuildJob
steps:
- script: echo Building!
Please check if it works.
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.