Nutshell Series

Azure DevOps Directory Variables

Azure DevOps pipelines provide predefined variables to reference paths, workspaces, and directories consistently. Here’s a simplified two-column version for better mobile responsiveness:

Variable Description & Example Paths
$(Build.SourcesDirectory) Sources folder where repository code is checked out.

Linux: /home/vsts/work/1/s

Windows: C:\agent\_work\1\s

$(Build.ArtifactStagingDirectory) Folder used for staging build artifacts before publishing.

Linux: /home/vsts/work/1/a

Windows: C:\agent\_work\1\a

$(Build.BinariesDirectory) Folder where intermediate build outputs and binaries are placed.

Linux: /home/vsts/work/1/b

Windows: C:\agent\_work\1\b

$(Pipeline.Workspace) Root workspace directory for the pipeline run.

Linux: /home/vsts/work/1/

Windows: C:\agent\_work\1\

$(Agent.ToolsDirectory) Folder where agent stores cached tools and SDKs.

Linux: /home/vsts/work/1/c

Windows: C:\agent\_work\1\c

$(Agent.TempDirectory) Temporary folder used during pipeline execution.

Linux: /home/vsts/work/_temp

Windows: C:\agent\_work\_temp

$(Build.Repository.LocalPath) Local path where repository content is downloaded.

Linux: /home/vsts/work/1/s

Windows: C:\agent\_work\1\s

$(Agent.WorkFolder) Agent’s root work folder that contains all pipeline runs.

Linux: /home/vsts/work

Windows: C:\agent\_work

$(Agent.BuildDirectory) Build-specific directory (same as workspace root).

Linux: /home/vsts/work/1/

Windows: C:\agent\_work\1\

$(Agent.HomeDirectory) Directory where agent software is installed.

Linux: /home/vsts/agent

Windows: C:\agent

Reference: Azure DevOps Predefined Build Variables

Leave a comment