title: ${{ if }} Syntax in Azure DevOps YAML
body: <p>I have a pool of self hosted VMs (MyTestPool) half of which is dedicated to installing &amp; testing a 'ON' build (that has few features turned on) and a 'OFF' build (that's a default installation).  All my test agent VMs have 'ALL' as a user defined capability. Half of them are also tagged 'ON', and the other half 'OFF'.</p>
  <p>Now I have 2 stages called DEPLOYOFF &amp; DEPLOYON that can be skipped if a Variable Group variable 'skipDeployOffStage' or 'skipDeployOnStage' is set to true.  What I would like to do is to use 'ALL' as an agent demand if only ON / OFF is to be tested.  If both ON &amp; OFF are to be tested, the appropriate stage would demand their respective 'ON' or 'OFF' VMs.</p>
  <p>Question:  The ${{ if }} DOES NOT WORK.</p>
  <pre><code>trigger: none
  pr: none
  
  
  pool: 'MyBuildPool'
  
  variables:
    - group: TEST_IF_VARIABLE_GROUP
    - name: subPool
      value: 'ON'
    - name: useAllPool
      value: $[ or(eq( variables.skipDeployOnStage, true), eq( variables.skipDeployOffStage, true)) ]
      
  stages:
  - stage: DEPLOYOFF
    condition: ne(variables['skipDeployOffStage'], 'true')
  
    variables:
      # The test stage's subpool
      ${{ if variables.useAllPool }}:
        subPool: 'ALL'
      ${{ if not(variables.useAllPool)  }}:
        subPool: 'OFF'
  
    pool: 
      name: 'MyTestPool'
      demands: 
        - ${{ variables.subPool }}
  
    jobs:
    - job:
  
      steps:
      - checkout: none
      - pwsh: |
          Write-Host (&quot;Value of useAllPool is: {0}&quot; -f '$(useAllPool)')
          Write-Host (&quot;Value of VG variable 'skipDeployOnStage' is {0} and 'skipDeployOffStage' is {1}&quot; -f '$(skipDeployOnStage)', '$(skipDeployOffStage)')
          Write-Host (&quot;Subpool is {0}&quot; -f '$(subPool)')
        displayName: 'Determined SubPool'
  </code></pre>
  <p>The Output when one of the flags is false:</p>
  <pre><code>2020-08-02T18:39:05.5849160Z Value of useAllPool is: True
  2020-08-02T18:39:05.5854283Z Value of VG variable 'skipDeployOnStage' is true and 'skipDeployOffStage' is false 
  2020-08-02T18:39:05.5868711Z Subpool is ALL
  </code></pre>
  <p>The Output when both are false:</p>
  <pre><code>2020-08-02T18:56:40.5371875Z Value of useAllPool is: False
  2020-08-02T18:56:40.5383258Z Value of VG variable 'skipDeployOnStage' is false and 'skipDeployOffStage' is false
  2020-08-02T18:56:40.5386626Z Subpool is ALL
  </code></pre>
  <p>What am I missing?</p>