Azure pipelines self-hosted agent retention

Copper Contributor

A client has a need to rerun certain deployment stages of an azure pipeline. The pipeline is ran on a self-hosted agent (because we need some installed CLI on that machine to build the app). The problem is that I expected each run of the pipeline to have a separate workspace folder, like this:

  • c:/agent/_work/1
  • c:/agent/_work/2
  • etc

This way, rerunning a stage would just work with the files in the workspace directory coupled to the run.

At some point, the agent stopped creating new workspace folders, and now each run is executed in the same folder (overwriting files that may have changed), which causes the reruns to fail or using the wrong version of the files.

Is this expected behavior? I already restarted the agent service and tried a lot of things, but it just keeps setting the same folder as my Pipeline.Workspace one. On the build server, I found a file Mappings.json which holds this:

	"lastBuildFolderCreatedOn": "12/13/2023 11:04:56 +01:00",
	"lastBuildFolderNumber": 35

Which I guess keeps track of this, but doesn't update on new runs of the pipeline.

0 Replies