What is the difference between "Download pipeline artifact" and "Download build artifacts"? Which one should be used and when?
-
Did you look at the documentation for those tasks? – Daniel Mann Nov 14 '19 at 19:31
2 Answers
Pipeline artifact: provide a way to share files between stages in a pipeline or between different pipelines. They are typically the output of a build process that need to be consumed by another job or be deployed. Artifacts are associated with the run they were produced in and remain available after the run has completed.
Using Download Pipeline Artifacts in a build or release pipeline to download pipeline artifacts from earlier stages in this pipeline, or from another pipeline.
Build artifact :Artifacts are the files that you want your build to produce. Artifacts can be anything that your team needs to test or deploy your app.
Using Download Build Artifacts in a build or release pipeline to download build artifacts.
Pipeline artifacts are the next generation of build artifacts and are the recommended way to work with artifacts. Artifacts published using the Publish Build Artifacts task can continue to be downloaded using Download Build Artifacts, but can also be downloaded using the latest Download Pipeline Artifact task.
Note: It is recommended upgrading from build artifacts to pipeline artifacts for faster output storage speeds.
Here are some documents you can refer to:

- 17,829
- 2
- 21
- 25
-
2I have two pipelines, one prepares files for the other, the second takes these files and turns them into an installation file. The first pipeline publishes artifacts now with "publish pipeline artifacts", the second one downloads them wit "download pipeline artifacts". After some tests performed by me it seems that "download pipeline artifacts" approximately 2 times slower then the classic task. Should it be like this? Why it is so? – deralbert Apr 30 '20 at 09:54
-
7So many words and I still don't understand what's the difference. – Sergey Kostrukov Mar 25 '21 at 22:05
-
DownloadBuildArtifacts@1
description:
Use this task to download files that were saved as artifacts of a completed build
DownloadPipelineArtifact@2
description
Use this task to download pipeline artifacts from earlier stages in this pipeline, or from another pipeline.
Based on that description I would say there is a semantic difference. The PublishBuildArtifacts
/DownloadBuildArtifacts
pair is intended for saving/downloading files which you also want to be the whole pipeline's output.
The PublishPipelineArtifact
/DownloadPipelineArtifact
on the other hand is intended for passing some intermediate results between stages.
So, I would expect files created with PublishBuildArtifacts
to be downloadable at the global pipeline level after pipeline has completed. And on the other hand, files created with PublishPipelineArtifact
to be downloadable either at the level of particular stage where they were produced, or not available for manual download at all. Like public
/private
artifacts, that was my 1st impression.
In practice both PublishPipelineArtifact
and PublishBuildArtifacts
will produce files downloadable from the main page of completed top-level pipeline. So, I don't see any difference between publish tasks, all artifacts gets published to the same place:
Additionally, there is the GitHub issue explaining the difference:
Pipeline Artifacts (published using the Publish Pipeline Artifact task) are intended as the replacement for Build Artifacts.
... The benefit of Pipeline Artifacts is that they can dramatically reduce the time it takes to upload and download large artifacts.
Even though I did not notice any functional difference in "publish" tasks, there is a notable difference in "download" tasks. Consider the following code:
- task: DownloadBuildArtifacts@1
displayName: Download xml test reports
inputs:
artifactName: xml test reports
downloadPath: $(System.DefaultWorkingDirectory)/build/test-results/
- task: DownloadPipelineArtifact@2
displayName: Download xml test reports
inputs:
artifactName: jUnit-xml-test-reports
targetPath: $(System.DefaultWorkingDirectory)/build/test-results/
It's all the same besides the names of the task types used. While you probably expect the result to be the same too, in practice the older task (DownloadBuildArtifacts
) will create an intermediate directory named after artifactName
you are downloading. So you will have /build/test-results/xml test reports/your-files
instead of just /build/test-results/your-files

- 6,762
- 4
- 51
- 81