3

I want to troubleshot a single step from Azure DevOps release pipeline (classic mode).

The step invokes similar command on deployment VM:

C:\azagent\A1\_work\_tool\VsTest\17.0.0\x64\tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe "@_work\_temp\qrjwcoj0moy.tmp

However the temp folder C:\azagent\A1\_work\_temp\ is removed. Can I keep keep the temp files in order to invoke the command manually?

Liero
  • 25,216
  • 29
  • 151
  • 297

2 Answers2

4

According to https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml (check "Agent.TempDirectory") it is not possible because temp folder is cleaned after each pipeline job.

If you want to keep these files you need to copy them (task: CopyFiles) to different folder before job ends to be able to check them later.

Kontekst
  • 946
  • 8
  • 17
2

I have added a step that copies the directory depending on the variable 'system.debug':

- task: CopyFiles@2
  inputs:
    SourceFolder: '$(Agent.TempDirectory)'
    Contents: '**'
    TargetFolder: '$(Build.ArtifactStagingDirectory)\AgentTempDirectory'
  displayName: 'Copy Agent.TempDirectory to drop'
  condition: eq(variables['system.debug'], 'true')
PainElemental
  • 687
  • 6
  • 14