A Virtual Machine that we use as a self host agent runned out of space on it's data disk resulting in failure to start agent services and running pipelines. The result was the agent in an idle state, not communicating to Azure DevOps Pipeline service. Extending Disk size of VM agent would help resolve this issue but would increase costs, instead a temporary solution was to delete older build logs from the _diag folder.
Looking inside the VM agent directory we can see the following folders:
Is there any tool that Azure provides to deal with this kind of problem?
Is the "_diag" folder the right one that needs the contents deleted?
Is there any kind of automation that can be used, for example in the pipelines?
Is the Maintenance job functionality of azure a solution for this problem?