Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS pass parameter in Pipeline between stages

I have two stages in my pipeline. The first one is the trigger for the second one. I want the parameter from first stage be input/accessible in the second stage. Is this feasible?

EDIT

The case is when the parameter value is set on stage 1 as of result of ARM or script output, then this value is not visible on next stages.

Thanks

like image 243
Leszek Avatar asked Oct 16 '22 13:10

Leszek


1 Answers

It is not possible this way to share variable from stage1 to stage2 in case when you are changing variable value in stage1, to achieve this you need to persist this value in some storage like for eg. keyvault, azure function or vsts api that you will change value for . The stage1 and stage2 can be running on different agent. What can be done is to edit variable value for stage2, in stage1 add task that is persisting this value using (vsts/tfs/azure devops) api and persisting this on release definition. Api for update release definition https://learn.microsoft.com/en-us/rest/api/vsts/release/definitions/update?view=vsts-rest-4.1

like image 119
Janusz Nowak Avatar answered Oct 28 '22 19:10

Janusz Nowak