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
For more information, see the YAML schema for pools. To choose a pool and agent in the classic editor, navigate to the pipeline settings, select the desired Agent pool, and then the desired image from the Agent Specification drop-down. The default Agent Specification is windows-2019.
You can deploy to Azure using YAML pipelines instead of classic Release pipelines. You can also see that this uses a Microsoft hosted build agent ubuntu-latest. This is to boot-strap the environment. After this pipeline runs, the self-hosted agent pool you created will have multiple build agents available for other pipelines to use.
If you wish to use Azure DevOps CLI with a YAML pipeline, you can use the following example to understand how YAML can be used to install Azure CLI, add the Azure DevOps extension, and run Azure DevOps CLI commands. The steps in this article show how to authenticate with Azure DevOps and run az devops commands using the Azure DevOps CLI extension.
The agents must have connectivity to the target on-premises environments, and access to the Internet to connect to Azure Pipelines or Team Foundation Server, as shown in the following schematic. To register an agent, you need to be a member of the administrator role in the agent pool.
· Issue #353 · microsoft/azure-pipelines-yaml · GitHub Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
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.
Use demands
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/demands?view=azure-devops&tabs=yaml
- stage: Deploy
pool: alm-aws-pool
demands:
- agent.name -equals deploy-05-agent1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With