After some time, your build agents start to eat up more and more disk space on your build server. Before I always cleaned it up manually when I get a warning from our system monitoring tools, but there is actually a better way I wasn’t aware of.
It is possible to schedule a Maintenance Job to clean up the _work folder in the agent:
Remark: As this has an impact on the availability of your pool it is recommended to limit the max percentage of agents running maintenance(25% by default).
Where can you find these setting?
- Login to your TFS or VSTS portal
- Open the Administration Section of the portal and go to the Agent Pools section
- On the Agent Pools page, select a specific pool from the list of available pools
- On the right choose the Settings tab