Skip to main content

Directory

  • Directory

Understanding the directory structure created by Azure DevOps tasks.

Overall look at the directory structure

This image shows a big-picture look at the directory structure after one complete run of the pipeline.

https://res.cloudinary.com/practicaldev/image/fetch/s--ffDkvO-F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lgl3rixyjoa8atfxc505.jpg

Summary of when each directory is used

Most of this information, though publicly available on the Microsoft docs, is not very intuitive to a beginner. I hope that this table summarizes the usage of the most relevant directories.

DirectoryUsesReferences
/aThis is the working director for agent a.Agent.WorkFolder
/a/1/aArtifact staging directory. This is where the VS Build task results are stored in. The publish build artifacts task creates an artifact of whatever is in this folder. Note - it gets purged before each new build.Build.StagingDirectory, System.ArtifactsDirectory, Build.ArtifactStagingDirectory
/a/1/bThe output folder for compiled binaries.Build.BinariesDirectory
/a/1/sSource directory. This is the working directory and where your source code is stored.Build.SourcesDirectory, System.DefaultWorkingDirectory