title: How can I access the `Build.BuildNumber` Azure variable from the inside of an ASP.NET application?
body: <p>How can I access the <code>Build.BuildNumber</code> Azure variable from the inside of an ASP.NET application?</p>
  <p>Is it the same as assembly number and can be retrieved using the (<a href="https://stackoverflow.com/questions/1168279/asp-net-version-build-number/1168329">source</a>)?</p>
  <pre><code>Assembly web = Assembly.Load(&quot;App_Code&quot;);
  AssemblyName webName = web.GetName();
  
  string myVersion = webName.Version.ToString();
  </code></pre>
  <p>I mean <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&amp;tabs=yaml" rel="nofollow noreferrer">this</a> <code>Build.BuildNumber</code>:</p>
  <blockquote>
  <p>The name of the completed build, also known as the run number. You can specify what is included in this value.</p>
  <p>A typical use of this variable is to make it part of the label format, which you specify on the repository tab.</p>
  <p>Note: This value can contain whitespace or other invalid label characters. In these cases, the label format will fail.</p>
  <p>This variable is agent-scoped, and can be used as an environment variable in a script and as a parameter in a build task, but not as part of the build number or as a version control tag.</p>
  </blockquote>