title: Tell if a variable exists in template with azure pipelines
body: <p>I'm trying to figure out a way to do the following</p>
  <pre><code>variables:
    ${{ if eq(variables['var-a'], exists_and_is_set) }}:
      namespaceName: $(var-a)
    ${{ if ne(variables['var-a'], exists_and_is_set) }}:
      namespaceName: $(var-b)
  </code></pre>
  <p>Basically, if variable A exists and has a value != null != '' then use it, otherwise use another variable.  The scripting here is pretty simplistic and I can't find a way to do this.  The reason for it is I'm making a change that out of several hundred cicd pipelines that use this template, only 10 or so will use <code>var-a</code>, so I'm trying to find a way to implement the logic without having to go update several hundred pipelines to include something they won't use.</p>