I am looking for a way to set in Azure DevOps .yaml file dynamic demand name.
Right now we have a few self-hosted build agents that are selected by Azure DevOps services randomly but sometimes we need to choose one agent to investigate why it is not working(or for other rare event). One way is to switch off all other agents and operate on this one desired(it affects our whole CI/CD). Second way is adding temporary pipeline and moving desired agent to next agent pool(it costs time).
I think best solution would be possibility to dynamically set demands. For example I can have in variable groups these:
"DemandName" = "IsBuildAgent"
"DemandValue" = "Yes"
Each agent would have this environment variable set ant it would always allow each agent to run pipeline, but if I would set before running pipeline below variables.
"DemandName" = "AgentNumber"
"DemandValue" = "BuildAgentNr6"
It would override library variables and only one agent would be able to run this pipeline.
pool:
name: MyBuildAgents
demands: $(DemandName) -equals $(DemandValue)
DemandValue is correctly evaluated but DemandName cannot be set right now. Is it possible to achieve in slightly changed way? Maybe should I change syntax? Or maybe should I propose this as new feature?
