Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
108 lines (84 sloc) 4.25 KB
title description ms.topic ms.prod ms.technology ms.assetid ms.manager ms.custom ms.author author ms.date monikerRange
Download Pipeline Artifact task
Download Pipeline Artifact task to download pipeline artifacts from earlier stages in this pipeline, or from another pipeline
reference
devops
devops-cicd
a433f589-fce1-4460-9ee6-44a624aeb1fb
hdixon
seodec18
wismyth
willsmythe
07/02/2019
azure-devops

Download Pipeline Artifact task

Use this task in a build or release pipeline to download pipeline artifacts from earlier stages in this pipeline, or from another pipeline.

::: moniker range="azure-devops"

YAML snippet

[!INCLUDE temp]

::: moniker-end

Arguments

Argument Description
buildType
Download artifacts produced by
Download artifacts produced by the current pipeline run, or from a specific pipeline run.
Options: current, specific
specificBuildWithTriggering
When appropriate, download artifacts from the triggering build
A boolean specifying whether to download artifacts from a triggering build.
tags
Build Tags
A coma-delimited list of tags. Only builds with these tags will be returned.
artifactName
Artifact Name
The name of the artifact to download. If left empty, all artifacts associated to the pipeline run will be downloaded.
itemPattern
Matching Patterns
One or more file matching patterns (new line delimited) that limit which files get downloaded. More Information on file matching patterns
targetPath
Destination Directory
Directory to download the artifact files. Can be relative to the pipeline workspace directory or absolute. If multi-download option is applied (by leaving an empty artifact name), a sub-directory will be created for each. See Artifacts in Azure Pipelines.
project
Project
The project GUID from which to download the pipeline artifacts.
definition
Build Pipeline
The definition ID of the build pipeline.
buildVersionToDownload
Build version to download
Specifies which build version to download. Options: latest, latestFromBranch, specific
branchName
Branch Name
Specify to filter on branch/ref name, for example: refs/heads/develop.
pipelineId
Build
The build from which to download the artifacts. For example: 1764
[!INCLUDE control-options-arguments-md]

Examples

Download a specific artifact

# Download an artifact named 'WebApp' to 'bin' in $(Build.SourcesDirectory)
- task: DownloadPipelineArtifact@2
  inputs:
    artifactName: 'WebApp'
    targetPath: $(Build.SourcesDirectory)/bin

Download artifacts from a specific project/pipeline

# Download artifacts from a specific pipeline.
- task: DownloadPipelineArtifact@2
  inputs:
    buildType: 'specific'
    project: 'FabrikamFiber'
    pipelineId: 12
    buildVersionToDownload: 'latest'

Download artifacts from a specific branch

# Download artifacts from a specific branch with a tag
- task: DownloadPipelineArtifact@2
  inputs:
    buildType: 'specific'
    project: 'FabrikamFiber'
    pipelineId: 12
    buildVersionToDownload: 'latestFromBranch'
    branchName: 'refs/heads/master'
    tags: 'testTag'

Download an artifact from a specific build run

# Download an artifact named 'WebApp' from a specific build run to 'bin' in $(Build.SourcesDirectory)
- task: DownloadPipelineArtifact@2
  inputs:
    buildType: 'specific'
    artifact: 'WebApp'
    targetPath: $(Build.SourcesDirectory)/bin
    project: 'FabrikamFiber'
    pipelineId: 12
    buildVersionToDownload: 'specific'
    pipelineId: 2995

Q&A

How can I find the ID of the Pipeline I want to download an artifact from?

You can find the ID of the pipeline in the 'Pipeline variables'. The pipeline ID is the system.definitionId variable.

Open source

This task is open source on GitHub. Feedback and contributions are welcome.

You can’t perform that action at this time.