Mr Bigglesw0rth
Mr Bigglesw0rth

Reputation: 215

Dynamic selection of values in YAML deployment pipelines

I'm writing a pipeline to deploy some "code" (flows used inside a product) into an environment. The Build portion is automatic, but the Deploy portion is manual and we use Git tags to flag and manage candidates for promotion.

I've seen examples for how to set up parameters in a DevOps pipeline, and I've also obviously seen how you can choose a branch or tag relating to the version of the repository source you wish to work with when you manually run the pipeline.

I'd like to combine the 2:

The pipeline then filters the tags that you can choose from. We want deployment to follow a set order, so you can only deploy into QA something that was already deployed previously into Test, etc.

At this point, the pipeline deploys the version related to the tag you selected from the curated options.

I can do this in Jenkins:

From what I've read so far:

So how do people do this in Azure? (Or don't they?) I know you can go into the dropdown and just select a tag from the complete list of tags in the repository, but there are no safeguards around that at all. Not what we want. Has anyone successfully implemented something like this before?

Upvotes: 1

Views: 759

Answers (1)

Kevin Lu-MSFT
Kevin Lu-MSFT

Reputation: 35474

I am afraid that there is no out-of-box method in Azure DevOps can meet your requirement completely.

When Azure DevOps pipeline is running, it is non-interactive and we cannot manually input/select the value of the Pipeline variable.

On the other hand, pipeline parameter setting occurs simultaneously, and it does not support setting the value of another parameter based on the value of one parameter.

For a workaround, you can split the pipeline into two.

The first pipeline can select a stage and get the corresponding tags through the selected stage. Then it will update the pipeline two YAML to set the parameters values.

The second pipeline can support select the updated parameters value of Pipeline One.

I can fully understand your requirement. You can create a suggestion ticket in Developer Community to report your requirement.

Upvotes: 1

Related Questions