Azure-pipelines-agent: how to use self-host agent for azure pipeline

Created on 1 Mar 2021  Â·  3Comments  Â·  Source: microsoft/azure-pipelines-agent

Hi, I want create a self-host agent and use it in pipeline. however, I had some problems importing the image.
the procedures are list in follow.

  1. create a self-host agent according to the link : [https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops]
    image

  2. import the agent image, I do not know the right format
    In other words, how could I replace lines 9 and 10 of the demo code with the self-host agent?
    image

Thanks

question

All 3 comments

Hi @tjinjin95
You should specify an agent pool name:

pool:
  name: 'AgentPoolName'

If you'd like to specify an exact agent in the pool you should do the following:

pool:
  name: 'AgentPoolName'
  demands:
  - agent.name -equals 'azurePipelineWindows'

Is this information helpful for you?

@egor-bryzgalov I still cannot specify the agent. The error log is as follows.
code:
image

first test:
image
second test:
image

capabilities:
image

Problem solved, could refer to the link: https://github.com/microsoft/azure-pipelines-agent/issues/2996

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fernisoites picture fernisoites  Â·  4Comments

AceHack picture AceHack  Â·  3Comments

BrendanThompson picture BrendanThompson  Â·  4Comments

johncollinson2001 picture johncollinson2001  Â·  4Comments

TLaborde picture TLaborde  Â·  3Comments