title: AzureDevOp convey information from one stage to another using scripts
body: <p><a href="https://i.stack.imgur.com/CQzfs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CQzfs.png" alt="Pipeline"></a></p>
  
  <p>I have a pipeline defined of two steps:</p>
  
  <ul>
  <li>one building a combined helm chart from two separate artifacts</li>
  <li>two deploying this chart to a cluster</li>
  </ul>
  
  <p>Both stages first load a secret and then run a bash script to do the work, as shown in the following image.</p>
  
  <p><a href="https://i.stack.imgur.com/o9od5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o9od5.png" alt="Steps"></a>
  My challenge now is, to submit the helm chart name and its version from the Build stage to the Deploy one. So that the 2 step can fetch the right chart.</p>
  
  <p>How can I achieve this?</p>
  
  <hr>
  
  <p>Trial 1: Using <code>##vso[task.setvariable</code> - Did not work from the script</p>
  
  <pre><code>echo "##vso[task.setvariable variable=HELM_CHART_NAME]$HELM_CHART_NAME"
  echo "##vso[task.setvariable variable=HELM_CHART_VERSION]$HELM_CHART_VERSION"
  </code></pre>