3
votes

I've been struggling with an issue in Azure DevOps where I can build successfully an artifact through a build pipeline (I use the publish artifact task). I can see that the artifact is built successfully, as I can download it and I can reference it later in the release pipeline.

The issue is that when the hosted agent is started, no artifacts are downloaded to the machine, and my $(System.DefaultWorkingDirectory) is always empty. I am out of ideas on why in the initialization of the hosted agent, no artifacts are actually being downloaded....

1

1 Answers

7
votes

I had the same issue this week. I set up my build with the 'Publish pipeline artifact' task and ran into the same issue as you, i replaced this with 'Publish build artifact' task in my build and everything worked out then.

I've read that 'Publish pipeline artifact' is only intended for uploading/downloading artifacts within the same pipeline, so thats why this won't get downloaded automatically in your release. Alternatively you could use the 'Download Pipeline Artifact' task in your release to explicitly download your artifact