Predefined Variables Azure DevOps

Share

Predefined Variables Azure DevOps

In Azure DevOps (now known as Azure DevOps Services or Azure DevOps Server, depending on the deployment), there are several predefined variables that you can use in your build and release pipelines. These variables provide information about the environment, pipeline, and other contextual details. Here are some common predefined variables in Azure DevOps:

  1. Build Variables:

    • Build.BuildId: The unique identifier for the current build.
    • Build.BuildNumber: The user-friendly build number for the current build.
    • Build.DefinitionName: The name of the build pipeline.
    • Build.DefinitionVersion: The version of the build pipeline.
    • Build.Repository.Name: The name of the source code repository.
    • Build.SourceBranch: The branch or source branch being built.
    • Build.SourceVersion: The commit or source version being built.
    • Build.SourcesDirectory: The local path on the agent where the source code is downloaded.
    • Build.ArtifactStagingDirectory: The local path on the agent where build artifacts are staged.
  2. Release Variables:

    • Release.ReleaseId: The unique identifier for the current release.
    • Release.ReleaseName: The user-friendly release name for the current release.
    • Release.EnvironmentName: The name of the release environment.
    • Release.DefinitionName: The name of the release pipeline.
    • Release.Artifacts.{Alias}.SourceVersion: The source version of a specific artifact.
    • Release.Artifacts.{Alias}.ArtifactUri: The URI of a specific artifact.
  3. Agent Variables:

    • Agent.Name: The name of the agent running the build or release.
    • Agent.WorkFolder: The local path on the agent where the build or release is running.
    • Agent.Id: The unique identifier of the agent.
  4. System Variables:

    • System.HostType: The type of the hosting agent (e.g., Build, Release, DeploymentGroup).
    • System.TeamFoundationCollectionUri: The URI of the Azure DevOps collection.
    • System.TeamProject: The name of the Azure DevOps project.
    • System.DefaultWorkingDirectory: The local path where tasks are run in the agent’s workspace.

These variables can be referenced in your pipeline scripts, templates, and tasks to customize your processes based on the provided context. You can access these variables using expressions like $(VariableName) or $[VariableName].

Keep in mind that the availability of these variables and their names might vary slightly between Azure DevOps Services and Azure DevOps Server, and new variables might be introduced over time as the platform evolves. Always refer to the official documentation for the most up-to-date and accurate information.

Demo Day 1 Video:

You can find more information about DevOps in this DevOps Link

 

Conclusion:

Unogeeks is the No.1 IT Training Institute for DevOps Training. Anyone Disagree? Please drop in a comment

You can check out our other latest blogs on  DevOps here – DevOps Blogs

You can check out our Best In Class DevOps Training Details here – DevOps Training

💬 Follow & Connect with us:

———————————-

For Training inquiries:

Call/Whatsapp: +91 73960 33555

Mail us at: info@unogeeks.com

Our Website ➜ https://unogeeks.com

Follow us:

Instagram: https://www.instagram.com/unogeeks

Facebook:https://www.facebook.com/UnogeeksSoftwareTrainingInstitute

Twitter: https://twitter.com/unogeeks


Share

Leave a Reply

Your email address will not be published. Required fields are marked *