如何在构建管道中指定我的自定义代理?

How do I specify my custom agent in the build pipeline?

我正在关注 Donovan Brown's blog post 尝试为 VB6 设置构建代理

我可以在代理池中看到我的代理

但是不知道放什么作为图片。

我尝试了 Default 和 vb6vm3,但无法使用这些值保存管道。

定位所需的队列,而不是池。尝试用下面的代码替换池代码。

  queue:
    name: Default

我还发现使用图形用户界面创建我的构建并使用“显示 YAML”按钮获取为我编写的 yaml 更加容易。

How do I specify my custom agent in the build pipeline?

我遇到了和你一样的问题。为了解决这个问题,我尝试使用可视化设计器创建一个新的构建管道,select 我的自定义私人代理,然后 select 选项查看 YAML:

我得到以下代码:

pool:
  name: VS2017PrivateAgent

而且效果很好。

但是我还是很好奇为什么我不能使用pool:vmImage以及如何将我的私人代理选项添加到下拉菜单中。

查了很多资料,在一个不起眼的地方找到了原因Pool:

pool:
  name: string  # name of the pool to run this job in
  demands: string | [ string ]  ## see below
  vmImage: string # name of the vm image you want to use, only valid in the Microsoft-hosted pool

评论您要使用的虚拟机映像的名称,仅在 Microsoft 托管的池中有效 是我无法使用的真正原因 pool:vmImage

If you're using a private pool and don't need to specify demands, this can be shortened to:

pool: string # name of the private pool to run this job in

希望这可以提供有关此问题的更多信息。