title: Use git or hg repository tag as version in Azure Pipelines
body: <p>I want to build a project in Azure Pipelines, but I want to know what the idiomatic way is to obtain the latest tag, latest tag distance, and repo remote path/URL in order to pass those values into the actual build script that is inside the repository.</p>
  
  <p>Previously our build script would invoke <code>hg log -r . --template</code> with a clever template, but we found when moving to Continua CI build server that the build agent doesn't have access to the actual repository during a build, and had to find another way.</p>
  
  <p>I'm assuming the same issue would crop up with Azure Pipelines and haven't quite found the relevant docs yet on artifact versioning.</p>
  
  <p>Many thanks in advance.</p>