Azure Predefined Variables

Share

 Azure Predefined Variables

Azure DevOps provides a wide range of predefined variables within Azure Pipelines that can be used to manage, customize, and control the behavior of your CI/CD workflows. These variables are automatically set by Azure DevOps and are available to be used in your pipeline tasks. They are categorized based on their scope and purpose. Here’s an overview of some of the key categories and examples of Azure predefined variables:

  1. Agent Variables: These variables provide information about the agent that is running the build or release pipeline.

    • Agent.Id
    • Agent.JobStatus
    • Agent.MachineName
    • Agent.OS
    • Agent.OSArchitecture
  2. Build Variables: These are specific to the build pipeline and give information about the build.

    • Build.BuildId
    • Build.BuildNumber
    • Build.DefinitionName
    • Build.Repository.Name
    • Build.SourceBranch
    • Build.SourceVersion
  3. Release Variables: These are specific to release pipelines.

    • Release.ReleaseId
    • Release.ReleaseName
    • Release.EnvironmentName
    • Release.DefinitionName
  4. System Variables: These provide information about the system or environment where the pipeline is running.

    • System.TeamProject
    • System.TeamFoundationCollectionUri
    • System.DefaultWorkingDirectory
  5. Pipeline Variables: These variables are related to the pipeline workspace.

    • Pipeline.Workspace
  6. Repository Variables: These provide information about the repository that triggered the pipeline.

    • Build.Repository.Provider
    • Build.Repository.URI
  7. Task Variables: Specific to tasks within a pipeline.

    • Task.DisplayName
  8. Common Variables: These are standard environment variables that are common to most CI/CD tools.

    • Env:PATH
    • Env:HOME
  9. Conditional Variables: Used to conditionally control the flow of the pipeline.

    • Build.Reason
  10. Custom Variables: In addition to the predefined variables, you can define your own custom variables within the pipeline.

You can use these variables in your YAML pipeline by referencing them with syntax like $(VariableName) for Windows and ${VariableName} for Linux and macOS. For example, to use the build ID, you would reference it as $(Build.BuildId) in your pipeline tasks.

These predefined variables are highly useful for scripting and automating various parts of your CI/CD process, such as dynamically setting paths, names, versions, and handling artifacts and deployments based on the context of the build or release.

For a comprehensive list and more detailed information, it’s recommended to refer to the Azure DevOps documentation, which provides extensive details on each variable and their possible use cases.

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 *