Assign specific agent on Azure DevOps YAML Pipelines

Viewed 15202

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
2 Answers

The pool name needs to add to the name field, then you could add demands. You may try the following Yaml Code:

stages:
- stage: Deploy
  pool: 
   name: AgentPoolName(e.g. alm-aws-pool)
   demands:
    - agent.name -equals Agentname (e.g. deploy-05-agent1)
  jobs:
  - job: BuildJob
    steps:
    - script: echo Building!

Please check if it could work.

Hope this helps.

Related