I wanted to pass a variable value from a deployment job to a subsequent job that depends on it.
Here is my complete test pipeline (almost entirely copied from here):
- stage: X
- deployment: A
- script: echo "##vso[task.setvariable variable=myOutputVar;isOutput=true]this is the deployment variable value"
- script: echo $(setvarStep.myOutputVar)
- job: B
myVarFromDeploymentJob: $[ dependencies.A.outputs['deploy.setvarStep.myOutputVar'] ]
- script: "echo $(myVarFromDeploymentJob)"
How can I pass a variable from a runOnce deployment job to a regular job?