title: How to have conditional image tags on azure devops build yaml pipeline?
body: <p>For several environments, I need to have different docker image tagging policies, that is: dev and release should utilize 'Latest' tag, while production should have proper version tag.</p>
  
  <p>I am currently using single Yaml file for all AzureDevOps Build Pipeline, and want to have image tagging mode to be defined as Variable per build /lets say called $(Versioned)/.</p>
  
  <p>The build step is shown below:</p>
  
  <pre>steps
  - bash: docker push $(imageFullName):latest
    displayName: 'docker push'</pre>
  
  <p>So is there any way to have IF statement or other conditional operation here.
  For example:</p>
  
  <pre>steps
  - bash: docker push $(imageFullName):IF($(Versioned), $(Build.BuildNumber), latest)
    displayName: 'docker push'</pre>