title: Pass variables from one job to an other in an azure multi stage pipeline (YAML)
body: <p>I have a very basic YAML azure pipeline </p>
  
  <pre><code>jobs:
  - job: Foo
    steps:
    - bash: |
        echo "Create variable xyz"
        echo "##vso[task.setvariable variable=xyz;]yes"
      displayName: 'Determine slot name'
    - bash: |
       echo "Var is: $(xyz)"
      displayName: 'Show variable'
  - job: Bar
    dependsOn: Foo
    steps:
    - bash: |
        echo "Hello world $(Foo.xyz)"
      displayName: 'Show variable'
  </code></pre>
  
  <p>In the first JOB, named <code>Foo</code>, the variable <code>xyz</code> is set to <code>yes</code>. Which works, because I can display it in the seconds step with the line </p>
  
  <pre><code>echo "Var is: $(xyz)"
  </code></pre>
  
  <p>However, I would like to use that variable in the next job (named <code>Bar</code>). But whatever I do it does not exist. I tried things like</p>
  
  <pre><code> echo "Hello world $(xyz)"
  </code></pre>
  
  <p>or</p>
  
  <pre><code> echo "Hello world $(Foo.xyz)"
  </code></pre>
  
  <p>But both give the following error when I run the pipeline</p>
  
  <pre><code> line 1: Foo.xyz: command not found
  </code></pre>
  
  <p>How can I share that variable between jobs? and sharing between stages would be nice too!!</p>