skip to Main Content

I’m trying to build an Azure DevOps pipeline that takes in 3-5 variables and runs a series of pipelines with those same variables passed through. Is it even possible or am I using variables incorrectly and I need to refactor the children pipelines to use parameters and somehow assign the variable to the parameter?

I have functional children pipelines that run when given variables. I tried to make a controller pipeline and pass the variables but they don’t appear to actually be passing. My pipelines error out on empty variables.

2

Answers


  1. This is not possible to pass variables between pipelines. You can try it instead invoke the pipeline from REST API and pass the value as a parameter.

    You can take a look here on this answer.

    Bu please take a look also on a different aspect. Do you really need sperate pipelines? Maybe it should be done via multiple stages? Than you would be able to pass output parameters between stages.

    Login or Signup to reply.
  2. Depending on the nature of your variables would recommend leveraging either [Variable Groups] (https://learn.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml) or Variable templates if they are not secret values.

    I would encourage variable templates first if you are leveraging YAML templates as this will put the variables under source control. The templates should be stored in a centralized repository which all the pipelines can access.

    Variable groups is supported by both Classic and YAML Pipelines. You can edit who has access to update the variables; however, there is not "source control" on it. Just an audit when a value changes.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search