Unable to copy .zip file created by an Azure Pipeline to a local PC folder

144 Views Asked by At

I'm trying to create a release azure pipeline that compresses a downloaded artifact (.zip file) directly on a local PC folder and then copy it into another. I run the release pipeline and it completes successfully, but both folders are empty.

Release pipeline overview

Here's an example of one run logs:

I tried to see if the file is hidden but I didn't find it. I also checked the permissions of both folders and 'Everyone' has full control on them.

Thanks in advance

3

There are 3 best solutions below

0
cristian00 On BEST ANSWER

FIXED:

The problem was that the release pipeline was running on AzureDevOps agent. After creating a self-hosted agent everything works properly.

0
Jonathan Myers On

Confusingly, the Pipeline.Workspace variable only works in YAML-based pipelines, not "classic" pipelines or "releases". You probably want Agent.ReleaseDirectory instead. Relevant docs

0
Miao Tian-MSFT On
  1. The Download Pipeline Artifact task is not needed. When you choose an artifact in the classic release pipeline, it will auto add a Download artifact task (this enter image description here task in your release pipeline) and download the artifacts to System.DefaultWorkingDirectory(Same as Agent.ReleaseDirectory and System.ArtifactsDirectory). So, you can delete the Download Pipeline Artifact task.

  2. Pipeline.Workspace is not a variable for the classic release pipeline. It is mentioned in the tips of this document. So, you can use the System.DefaultWorkingDirectory in the Archive files task.

If you are using classic release pipelines, you can use classic releases and artifacts variables to store and access data throughout your pipeline.

The modified Archive files task:

enter image description here

The modified Copy files task:

enter image description here

My test result:

enter image description here