在Azure DevOps YAML管道上分配特定代理

在Azure DevOps YAML管道上分配特定代理,azure,azure-devops,azure-pipelines,azure-pipelines-yaml,azure-pipelines-release-task,Azure,Azure Devops,Azure Pipelines,Azure Pipelines Yaml,Azure Pipelines Release Task,我正在尝试在我的代理池中指定一个特定的代理,但我不知道如何执行此操作。有人知道吗 我尝试过这个,但不起作用: - stage: Deploy pool: alm-aws-pool agent.name: deploy-05-agent1 使用需求 池名称需要添加到名称字段,然后您可以添加需求。您可以尝试以下Yaml代码: stages: - stage: Deploy pool: name: AgentPoolName(e.g. alm-aws-pool) de

我正在尝试在我的代理池中指定一个特定的代理,但我不知道如何执行此操作。有人知道吗

我尝试过这个,但不起作用:

- stage: Deploy
  pool: alm-aws-pool
    agent.name: deploy-05-agent1
使用需求


池名称需要添加到
名称
字段,然后您可以添加
需求
。您可以尝试以下Yaml代码:

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!
请检查它是否能工作


希望这能有所帮助。

Hi@Kontekst这对我的工作不起作用。我有一个错误:在此上下文中不允许映射值
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!