Passing variables between jobs for Azure DevOps pipelines
Using Azure DevOps, you can create pipeline variables dynamically. Out of the box, most dynamic variables are scoped to the job. But, if you need to, you can reference pipeline variables defined in other jobs. For example, if you have a stage that ha...
gaunacode.com2 min read
Like lavoizer mentioned, the example does not work.
Fixed it for you:
variables: someName: someValue stages: - stage: stage_deploy displayName: Production jobs: - job: job_deploy_infrastructure displayName: Deploy Some Infrastructure steps: - bash: | SOMEVALUE="bleh" echo "##vso[task.setvariable variable=someName;isOutput=true;]$SOMEVALUE" echo "variable value is $(someName)" name: setVariable - job: job_deploy_code displayName: Deploy Some Code dependsOn: ['job_deploy_infrastructure'] variables: someName: $[ dependencies.job_deploy_infrastructure.outputs['setVariable.someName'] ] steps: - bash: | echo "the variable value is $(someName)"