Azure DevOps Pipelines CI Windows available environment variables
Azure DevOps Pipelines CI Windows available environment variables
Here are some very basic terms that make understanding the variables easier.
Description: Build directory for the job.
Example: D:\a\1
Description: Disable log plugin test file publisher plugin for the job.
Example: true
Description: Disable log plugin test result log plugin for the job.
Example: true
Description: Home directory for the agent.
Example: C:\agents\2.155.1
Description: Agent ID.
Example: 78
Description: Job display name.
Example: environment variables
Description: Status of the job.
Example: Succeeded
Description: Machine name.
Example: fv-az433
Description: Agent name.
Example: Hosted Agent
Description: OS for the job.
Example: Windows_NT
Description: Whether the agent is running on x64 or x86 architecture.
Example: X64
Description: Retain default encoding in job.
Example: false
Description: Root directory for the job.
Example: D:\a
Description: OM directory for the job.
Example: C:\agents\2.155.1\externals\vstsom
Description: The agent’s temp directory.
Example: D:\a\_temp
Description: Tool’s directory.
Example: C:/hostedtoolcache/windows
Description: The agent version.
Example: 2.155.1
Description: The agent workfolder.
Example: D:\a
Description: The status of the job.
Example: Succeeded
Description: Location of all users’ profile.
Example: C:\ProgramData
Description: Android home.
Example: C:\Program Files (x86)\Android\android-sdk
Description: Android NDK home.
Example: C:\Microsoft\AndroidNDK64\android-ndk-r15c
Description: Android NDK path.
Example: C:\Microsoft\AndroidNDK64\android-ndk-r15c
Description: Apache Ant home.
Example: C:\ProgramData\chocolatey\lib\ant\apache-ant-1.10.5
Description: App data directory.
Example: C:\Users\VssAdministrator\AppData\Roaming
Description: Location of Azure extensions.
Example: C:\Program Files\Common Files\AzureCliExtensionDirectory
Description: HTTP user agent identification.
Example: VSTS_aea1cc4e-9bc6-4c7b-8950-a47d7d2e4e06_build_2_0
Description: Boost root location for 1.69.0.
Example: C:\Program Files\Boost\1.69.0
Description: Boost root location.
Example: C:\Program Files\Boost\1.69.0
Description: Staging directory for the build artifacts.
Example: D:\a\1\a
Description: Binaries directory for the build.
Example: D:\a\1\b
Description: Incrementing number giving build ID.
Example: 64
Description: Name given to the build in the azure-pipelines.yml
. This YAML line resulted in the example below:
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
Example: YakDriver.azure-pipelines-environment-variables_20190909.01
Description: Build URI.
Example: vstfs:///Build/Build/64
Description: Container ID.
Example: 4167856
Description: The build definition name (username.repository_name
).
Example: YakDriver.azure-pipelines-environment-variables
Description: The build definition version.
Example: 1
Description: Whether a user or webhook queued the build. If manually queued, the username will appear, or if queued by webhook from a Git host, e.g., GitHub, that name appears.
Example: GitHub
or YakDriver
(username)
Description: ID of the queueing entity.
Example: e692fbfb-6e19-6464-9e8d-e2533a449c63
Description: Semi-describes reasons for building.
Example: Manual
or PullRequest
or BatchedCI
(merged pull request or new tag)
Description: Seems to always be false.
Example: False
Description: Whether repository submodules are to be checked out.
Example: False
Description: The ID of the current repository (see BUILD_REPOSITORY_NAME
).
Example: YakDriver/azure-pipelines-environment-variables
Description: Where the repository was cloned locally.
Example: D:\a\1\s
Description: The name of the current repository (see BUILD_REPOSITORY_ID
).
Example: YakDriver/azure-pipelines-environment-variables
Description: The Git host that hosts the current repository.
Example: GitHub
Description:
Example: https://github.com/YakDriver/azure-pipelines-environment-variables
Description: Depends on whether manually launched or launched by webhook from, e.g., GitHub.
Example: GitHub
or YakDriver
(username)
Description: If launched manually from Azure Pipelines, your associated email address will show up here.
Example: dirk@example.com
Description:
Example: e692fbfb-6e19-6464-9e8d-e2533a449c63
Description:
Pull request (PR) example: refs/pull/1/merge
Merge pull request, or manual build on a branch example: refs/heads/master
Tag example: refs/tags/v0.1.0
Description: This does not always contain the branch name, such as on a pull request, when it contains merge
. If the build corresponds to a new tag, this contains the new tag name.
Pull request (PR) example: merge
Merge pull request, or manual build on a branch example: master
Tag example: v0.1.0
Description:
Example: D:\a\1\s
Description: Current Git hash of the target branch.
Example: 6451d5a2ea8f90ff2453dc8d9b434d545041166d
Description:
Example: Dirk Avery
Description: For a pull request, this provides the Git hashes - the hash of the current commit and the hash of the branch head where the commit would be merged. On a manual build on a branch, this contains the commit message.
Pull request (PR) example: Merge 4072182801f9d627f33593f2b0f38924d365cd0f into 6451d5a2ea8f90ff2453dc8d9b434d545041166d
Manual build on a branch example: Add ap yaml file
(Git commit message)
Tag example: Merge pull request #1 from YakDriver/update-envs
Description:
Example: D:\a\1\a
Description:
Example: C:\ProgramData\chocolatey
Description:
Example: C:\SeleniumWebDrivers\ChromeDriver
Description:
Example: C:\cobertura-2.1.1
Description:
Example: D:\a\1\TestResults
Description:
Example: C:\Program Files (x86)\Common Files
Description: (Camel case on CMD and PowerShell.)
Example: C:\Program Files\Common Files
Description:
Example: C:\Program Files\Common Files
Description:
Example: fv-az433
Description: (Camel case on CMD and PowerShell.)
Example: C:\windows\system32\cmd.exe
Description:
Example: C:\Miniconda
Description: (Bash only.)
Example: https://dev.azure.com/yakdriver/
Description: (Bash only.)
Example: C:\Program Files\Git\bin
Description:
Example: C:\SeleniumWebDrivers\GeckoDriver
Description:
Example: 0
Description:
Example: C:\Go1.10.8
Description:
Example: C:\Go1.11.12
Description:
Example: C:\Go1.12.7
Description:
Example: C:\Go1.9.7
Description:
Example: C:\Go1.12.7
Description:
Example: C:\ProgramData\chocolatey\lib\gradle\tools\gradle-5.6
Description: (Bash only.)
Example: /c/Users/VssAdministrator
Description:
Example: C:
Description:
Example: \Users\VssAdministrator
Description:
Example: C:\SeleniumWebDrivers\IEDriver
Description:
Example: 157.1
Description: (Bash only, arguments to the env
command.)
Example: ``
Description:
Example: C:\Program Files\Java\zulu-11-azure-jdk_11.33.15-11.0.4-win_x64
Description:
Example: C:\Program Files\Java\zulu-7-azure-jdk_7.31.0.5-7.0.232-win_x64
Description:
Example: C:\Program Files\Java\zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64
Description:
Example: C:\Program Files\Java\zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64
Description:
Example: C:\Users\VssAdministrator\AppData\Local
Description:
Example: \\fv-az433
Description:
Example: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.6.1
Description:
Example: C:\ProgramData\m2
Description:
Example: \bin
Description:
Example: -Xms256m
Description:
Example: VSTS_aea1cc4e-9bc6-4c7b-8950-a47d7d2e4e06_build_2_0
Description:
Example: C:\Program Files\Microsoft MPI\Bin\
Description: (Bash only.)
Example: MINGW64
Description:
Example: C:\npm\cache
Description:
Example: C:\npm\prefix
Description:
Example: 2
Description:
Example: Windows_NT
Description: (Camel case on CMD and PowerShell.)
Bash example: /mingw64/bin:/usr/bin:/c/Users/VssAdministrator/bin:/c/agents/2.155.1/externals/git/cmd...
CMD and PowerShell example: Path=C:\agents\2.155.1\externals\git\cmd;C:/hostedtoolcache/windows\Python\3.6.8\x64;C:/hostedtoolcache/windows\Python\3.6.8\x64\Scripts;C:\Program Files\Mercurial\;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\Program Files\Mercurial\;C:\Program Files\Boost\1.69.0...
Description:
Example: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY
Description:
Example: c:\tools\php
Description:
Example: D:\a\1
Description: (Bash only.)
Example: ssh
Description:
Example: AMD64
Description:
Example: Intel64 Family 6 Model 79 Stepping 1, GenuineIntel
Description:
Example: 6
Description:
Example: 4f01
Description:
Example: C:\ProgramData
Description:
Example: C:\Program Files (x86)
Description: (Camel case on CMD and PowerShell.)
Example: C:\Program Files
Description:
Example: C:\Program Files
Description: (CMD only.)
Example: $P$G
Description:
Example: C:\Modules\azurerm_2.1.0;C:\Modules\azure_2.1.0;C:\Users\packer\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Microsoft SQL Server\130\Tools\PowerShell\Modules\
Description: (CMD and PowerShell only.)
Example: Unrestricted
Description:
Example: C:\Users\Public
Description:
Example: /d/a/1/s
Description:
Example: C:/hostedtoolcache/windows\Python\3.6.8\x64
Description:
Example: C:/hostedtoolcache/windows
Description: (Bash only.)
Example: 1
Description:
Example: D:\a\1\a
Description:
Example: aea1cc4e-9bc6-4c7b-8950-a47d7d2e4e06
Description:
Example: https://dev.azure.com/yakdriver/
Description:
Example: en-US
Description:
Example: D:\a\1\s
Description:
Example: 2
Description:
Example: YakDriver.azure-pipelines-environment-variables
Description:
Example: SecretVariable
Description:
Example: build
Description:
Example: False
Description:
Example: 1
Description:
Example: environment variables
Description:
Example: 9cd7d73b-785a-5059-5c5c-3f86b8afeb34
Description:
Example: env.__default
Description:
Example: __default
Description:
Example: Public
Description:
Example: 1
Description:
Example: 1
Description:
Example: environment variables
Description:
Example: 37905b85-ba64-57a9-b162-719366a83dda
Description:
Example: env
Description:
Example: 2019-09-09 15:12:39-04:00
Description:
Example: 50e3405c-d780-4774-8541-b0fdb2b26341
Description: Even though pull request related, this appears in non-pull-request builds.
Example: False
Description: Only on a pull request.
Example: ``
Description: Only on a pull request.
Example: 315675853
Description: Only on a pull request.
Example: 1
Description: Only on a pull request.
Example: update-envs
Description: Only on a pull request.
Example: 4072182801f9d627f33593f2b0f38924d365cd0f
Description: Only on a pull request.
Example: https://github.com/YakDriver/azure-pipelines-environment-variables.git
Description: Only on a pull request.
Example: master
Description:
Example: Hosted
Description:
Example: 1
Description: The display name for the stage.
Example: __default
Description: A UUID for the current stage.
Example: 96ac2280-8cb4-5df5-99de-dd2da759617d
Description: The stage name.
Example: __default
Description: The URI for the step definitions.
Example: https://dev.azure.com/yakdriver/
Description: The display name for the current step.
Example: bash environment variables
Description: A UUID for the current step.
Example: ce30c491-54d2-5ab2-f73d-c2aceaff5b23
Description: What type of step is currently running.
Example: Bash
Description: The collection URI for the Team Foundation Server (now Azure DevOps Server).
Example: https://dev.azure.com/yakdriver/
Description: The URI for the Team Foundation Server (now Azure DevOps Server).
Example: https://dev.azure.com/yakdriver/
Description: The team project.
Example: dirkavery
Description: A UUID for the team project.
Example: e556bba9-d99e-42da-baad-6ed357d52dcf
Description: A UUID for the system timeline.
Example: 50e3405c-d780-4774-8541-b0fdb2b26341
Description: How many parallel jobs are in phase.
Example: 1
Description: The system workfolder.
Example: D:\a
Description: The purpose of the system perhaps.
Example: build
Description: (Camel case on CMD and PowerShell.) The drive where the system lives.
Example: C:
Description: (Camel case on CMD and PowerShell.) The Windows system root.
Example: C:\windows
Description: The display name of the current task.
Example: bash environment variables
Description: The location of temporary directory.
Bash example: /tmp
CMD and PowerShell example: C:\Users\VSSADM~1\AppData\Local\Temp
Description: (Bash only.) The terminal emulator.
Example: cygwin
Description: Whether this is a Team Foundation (now Azure DevOps) build.
Example: True
Description: The location of temporary directory.
Bash Example: /tmp
CMD and PowerShell example: C:\Users\VSSADM~1\AppData\Local\Temp
Description: If you have a job or build-level user-defined variable, it will show up in the environment as well. This is an example.
Example: the value of this variable
Description: The roaming profile in the domain.
Example: fv-az433
Description: The domain of the container.
Example: fv-az433
Description: The username running the build.
Example: VssAdministrator
Description: The user profile location.
Example: C:\Users\VssAdministrator
Description: The VCPKG installation root.
Example: C:\vcpkg
Description: The location of VS140 common tools.
Example: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
Description: The VSTS agent performance log.
Example: c:\vsts\perflog
Description: The lookup ID of the VSTS process.
Example: vsts_d35522da-a32f-41c8-bded-bc0b6eaf1530
Description: (Lowercase on CMD and PowerShell.) The location of Windows.
Example: C:\windows
Description: The location of WiX.
Example: C:\Program Files (x86)\WiX Toolset v3.11\