2
votes

I currently have a release pipeline with a number of stages. In the Deployment group job I have to specify Deployment group (which is fine), but in order to run my pipeline on a specific VM(agent) in that group I also have to specify some tags to limit the number of matching targets.

Instead of using tags in the Deployment group job I would like to use a variable to specify which VM(agent) to use. This variable can then be set when the release is created. Is this something that can be achieved in some way?

1
Are you using self-hosted agents or microsoft-hosted?ZetaPR
They are microsoft hosted.7oy8oy
Why then do you want to select which agent perform the deploy?ZetaPR
Ideally, I would like to control this through a variable in the pipeline that is "settable at release time". The reason for this is that I am forced to use a deployment group with VMs that are not all the same. I can only use a few of them for this particular pipeline. I know this is not how it is supposed to work, but as a workaround I am curious to know if there is a way to do this.7oy8oy
But why, I mean you don't control the infrastructure and then you don't mind which agent performs the deploy. It doesn't make any sense, I would understand it if you have self-hosted agents, but no with Microsoft hosted ones.ZetaPR

1 Answers

0
votes

I think that the only way to do this would be through Agent capabilities. In self-hosted agents a capability is:

Capabilities are name-value pairs that are either automatically discovered by the agent software, in which case they are called system capabilities, or those that you define, in which case they are called user capabilities.

Under your Agent pools if you select your agent you will discover a tab Capabilities. For self-hosted, you could determine a user-defined capability. These means to have a capability you will later check during release time. How could you provide that info? In your YAML you will specify:

pool:
  name: Default
  demands: SpecialSoftware # Check if SpecialSoftware capability exists 

What this will do is only agents that meet those capabilities will be suitable to perform the deploy

And remember this if anyone finds this answer, for Microsoft hosted agents:

Demands and capabilities apply only to self-hosted agents. When using Microsoft-hosted agents, you select an image for the hosted agent. You cannot use capabilities with hosted agents.