In Azure Pipelines when you use the classic task based pipeline, you can use the Clean option to clean up the working directory of your private agent before the build is run. You can find this setting by clicking on the Get Sources section in the pipeline editor. If you set this option to True you can choose what you exactly want to clean up: Using this option has a clear performance impact but can be useful in situations where the build is showing strange behavior. YAML pipelines But what if you are using YAML pipelines? When using YAML pipelines, you can achieve the same goal by configuring the workspace clean option on the job: When you specify one of the clean options, they are interpreted as follows: outputs : Delete Build.BinariesDirectory before running a new job. resources : Delete Build.SourcesDirectory before running a new job. all : Delete the entire Pipeline.Workspace directory before running a new job. It is also possible to use