Search code examples
azure-devopsazure-pipelinesdevopsazure-devops-self-hosted-agent

Is there a way to name the azure agent working folders


When you set up an azure devops agent on a build machine, it will have a working folder (by default _work) where it will create subfolders for each pipeline that it has to run.

These folders have integer names like "80" or "29". This makes it hard to trouble shoot issues on a given build machine, when you have many pipelines, as you don't know which folder it each pipeline relates to.

Is there a way to figure out the mapping from pipeline > folder number, or to name these folders more explicitly?


Solution

  • Rename the folders is currently not supported in Azure DevOps.

    Each pipeline maps a folder in the agent-> _work.

    enter image description here

    1.You could check the pipeline log to figure out which folder is your pipeline's working folder. (Enable system diagnostics)

    enter image description here

    2.You could also add a command line task in your pipeline to echo this directory.

    echo $(System.DefaultWorkingDirectory)
    

    enter image description here