Essentially, I have, say, 10 Pipelines that all run at the same time on 3 available Agents. So only 3 run at a time, and the rest are queued. I need each pipeline to have a variable that I can use for the entire pipeline, but I need that variable to be chosen from a specific list. Furthermore, I would like the variable that is chosen, to not be able to be chosen by another pipeline while it is being used by one. Once that Pipeline is finished, that variable can then be used again by a different Pipeline. So I would like each Pipeline to choose from a list of available options and set one of those options as a Pipeline variable, then free up that option for a later running Pipeline to be able to choose it again. Is this possible?
Asked
Active
Viewed 150 times
1 Answers
0
No, this cannot be accomplished. With YAML pipelines you can specify parameters and possible values, but your desired locking requirements can't be added.
Simple, but unfortunate answer.
If what you're trying to do is make sure pipelines aren't accessing the same environments or resources, then you may want to look into the 'Environments' and deployment stages. With policies on the environment or specific environment resources, you can prevent 2 pipelines from attempting to access the same environment or the same resource in an environment at the same time.
There is no queue-time block, the pipeline will just wait its turn.

jessehouwing
- 106,458
- 22
- 256
- 341
-
I really just want each pipeline to do the same thing just using a different value for a specific variable. Maybe if I clarify, that would make it clearer. Not necessarily looking for a built in simple thing that azure provides, maybe an idea, or a task that can be repurposed for my use case. Essentially I have several pipelines that all run at the same time, and just run selenium tests on a web app. They all run on 3 Agents, and use localhost. But I would like each pipeline to choose from a list of hostnames instead, and use that for the whole pipeline. – Maxperryg Nov 24 '20 at 18:24
-
Sounds like you want a single pipeline with multiple jobs/stages in it. That way you can queue all 3 jobs in a single go. – jessehouwing Nov 24 '20 at 19:08
-
I already have like 10 pipelines. And 3 run at a time because they pick from 3 available external Agents. I would like to add a task to each Pipeline that will set a hostname variable of sorts by choosing that value from a list. But I want that hostname to not be able to be picked by another Pipeline while it is in use – Maxperryg Nov 24 '20 at 19:31
-
Again, that can not be done, except for grouping jobs that run together in a single pipeline and assigning them an environment if environment resource. – jessehouwing Nov 24 '20 at 20:31