5

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

riQQ
  • 9,878
  • 7
  • 49
  • 66
Leszek
  • 451
  • 5
  • 19

1 Answers1

3

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

Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36
  • 1
    If you are a fan of PowerShell you can leverage the AzurePipelinesPS module to update the release definition with a PowerShell task. Edit: https://www.powershellgallery.com/packages/AzurePipelinesPS/2.0.32 – Dejulia489 Aug 13 '19 at 18:40
  • 1
    Will check that :) – Janusz Nowak Aug 16 '19 at 07:44