title: Can Conditional Variable Assignment be Done in Azure Pipelines?
body: <p>Azure Pipelines has <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#functions" rel="noreferrer">Expressions</a> and <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops" rel="noreferrer">Conditions</a>, but I can find no way to assign one of two values to a <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&amp;tabs=yaml%2Cbatch#set-variables-using-expressions" rel="noreferrer">variable</a>, based on a condition.</p>
  
  <p>Is there any way to accomplish what this pseudo-code would?</p>
  
  <pre><code>    ${{ if endsWith( variables['Build.SourceBranchName'], '/master' ) }}: 
        buildVersion: variables['mavenVersion']
      ${{ else }}: 
        buildVersion: variables['Build.SourceBranchName']
  </code></pre>