Azure DevOps Built in Variables

Share

Azure DevOps Built in Variables

Azure DevOps provides a set of predefined, built-in variables that are available in your build and release pipelines. These variables can be used for various purposes such as controlling the flow of the pipeline, accessing system information, and setting configuration parameters. Here’s an overview of some key built-in variables in Azure DevOps:

  1. System Variables:

    • System.AccessToken: The access token used by the running build.
    • System.CollectionUri: The URL of the Azure DevOps server or Azure DevOps Services organization.
    • System.DefaultWorkingDirectory: The local path on the agent where your source code files are downloaded.
    • System.DefinitionId: The ID of the build definition.
    • System.TeamProject: The name of the project.
  2. Agent Variables:

    • Agent.BuildDirectory: The directory where the build is taking place.
    • Agent.HomeDirectory: The directory path of the agent.
    • Agent.Id: The ID of the agent.
    • Agent.MachineName: The name of the machine on which the agent is installed.
    • Agent.OS: The operating system of the build agent.
  3. Build Variables:

    • Build.BuildId: The ID of the build.
    • Build.BuildNumber: The number of the build.
    • Build.BuildUri: The URI used to access this build.
    • Build.Repository.Name: The name of the repository.
    • Build.SourceBranch: The branch in the repository that triggered the build.
  4. Release Variables:

    • Release.ReleaseId: The ID of the release.
    • Release.ReleaseName: The name of the release.
    • Release.EnvironmentName: The name of the release environment.
    • Release.DefinitionName: The name of the release definition.
  5. Repository Variables:

    • Build.Repository.Provider: The type of repository (e.g., TfsGit, TfsVersionControl).
    • Build.Repository.LocalPath: The local path on the agent where your source code files are downloaded for builds.
    • Build.Repository.Name: The name of the repository.
  6. Pipeline Variables:

    • These are custom variables defined in the pipeline or passed in at queue time.
  7. Predefined Variables for Pull Requests:

    • System.PullRequest.PullRequestId: The ID of the pull request that triggered the build (if any).
    • System.PullRequest.SourceBranch: The source branch of the pull request.

Azure DevOps also allows you to define your own custom variables in the pipeline, which can be used alongside these built-in variables. You can access these variables in your build and release processes, and they can be used in scripts and tasks to dynamically manage behavior based on the environment or the context of the pipeline execution.

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 *