0
votes

We need to be able to deploy to two different deployment groups, Development1 and QA for example, but use the Development variables in the QA release. We actually have 10 different releases that double up like this.

I've set up 2 stage/environment in a release definition. Development1 runs first and then QA is deployed by using an after stage trigger. The QA deployment needs to use the variables from Development1, not the default variables in the QA library based on the environment name. I need some way to have teh QA deployment use the Development1 variable set.

It looks like yaml has a way to do this but, we aren't using yaml for release definitions. I'm not coming up with a solution and hope someone may have an idea how to get this to work.

1
Hi @Dan Fergus. Is there any update about this ticket? You could check if the answer could give you some help. Feel free to let me know if you have questions. Just a remind of this. - Kevin Lu-MSFT

1 Answers

0
votes

In Azure Devops Release pipeline , the Development1 stage and QA stage are independent.

So there is no direct method could share variable from stage1 to stage2 (release pipeline).

Workaround

You need to store Development1 stage output variables in one storage(e.g. keyvault, azure function or rest api). Then the QA stage could get the variable in the storage.

For example: store it in Azure Key vault with the task Azure Key Vault actions or Write Secrets to Key Vault.

Another way is use rest api to add it as the release variable with powershell script:

PUT https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}?api-version=5.0

In next stage, it can access and get variable from Release Variables.

By the way, Yaml now supports passing variables directly from stage1 to stage2 via expression. But it is currently limited to yaml based.