There are several predefined variables that you can use within an Azure DevOps pipeline, some of which allow you to reference locations on the pipeline agent file system. Examples of when to use them might be to pick up a file from the downloaded repository or to describe where to output a build. For example the variable
$(Build.ArtifactStagingDirectory)
will be replaced during the defining of the pipeline job with the respective filepath.I find it difficult at times to work abstractly with the file system, and so I use this template to visualise the file system for debugging purposes, to observe the outcome of my code, and to make sure I’m picking the right variable.
Click through for some more information about pre-defined variables and a code snippet Justin uses to view filesystem details.