Download Build Artifacts task

Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018

Note

We recommend upgrading from build artifacts to Pipeline Artifacts for faster performance.

Use this task to download build artifacts.

YAML snippet

# Download build artifacts
# Download files that were saved as artifacts of a completed build
- task: DownloadBuildArtifacts@0
  inputs:
    #buildType: 'current' # Options: current, specific
    #project: # Required when buildType == Specific
    #pipeline: # Required when buildType == Specific
    #specificBuildWithTriggering: false # Optional
    #buildVersionToDownload: 'latest' # Required when buildType == Specific. Options: latest, latestFromBranch, specific
    #allowPartiallySucceededBuilds: false # Optional
    #branchName: 'refs/heads/master' # Required when buildType == Specific && BuildVersionToDownload == LatestFromBranch
    #buildId: # Required when buildType == Specific && BuildVersionToDownload == Specific
    #tags: # Optional
    #downloadType: 'single' # Choose whether to download a single artifact or all artifacts of a specific build. Options: single, specific
    #artifactName: # Required when downloadType == Single
    #itemPattern: '**' # Optional
    #downloadPath: '$(System.ArtifactsDirectory)' 
    #cleanDestinationFolder: false # Optional
    #parallelizationLimit: '8' # Optional
    #extractTars: false # Optional

Arguments

Argument Description
buildType
Download artifacts produced by
(Required) Download artifacts produced by the current build, or from a specific build
Default value: current
project
Project
(Required) The project from which to download the build artifacts
definition
Build pipeline
(Required) Select the build pipeline name
Argument aliases: pipeline
specificBuildWithTriggering
When appropriate, download artifacts from the triggering build
(Optional) If true, this build task will try to download artifacts from the triggering build. If there is no triggering build from the specified pipeline, it will download artifacts from the build specified in the options below.
Default value: false
buildVersionToDownload
Build version to download
(Required) Specify which version of the build to download.
  • Choose latest to download the latest available build version
  • Choose latestFromBranch to download the latest available build version of the branch specified by branchName and tags specified by tags
  • Choose specific to download the build version specified by buildId
    allowPartiallySucceededBuilds
    Download artifacts even from partially succeeded builds
    (Optional) If checked, this build task will try to download artifacts whether the build is succeeded or partially succeeded
    Default value: false
    branchName
    Branch name
    (Required) Specify to filter on branch/ref name.
    Default value: refs/heads/master
    buildId
    Build
    (Required) The build from which to download the artifacts
    tags
    Build tags
    (Optional) A comma-delimited list of tags. Only builds with these tags will be returned.
    downloadType
    Download type
    (Required) Choose whether to download a single artifact or all artifacts of a specific build.
    Default value: single
    artifactName
    Artifact name
    (Required) The name of the artifact to download
    itemPattern
    Matching pattern
    (Optional) Specify files to be downloaded as multi-line minimatch pattern. More Information.
    The default pattern will download all files across all artifacts in the build if the Specific files option is selected. To download all files within an artifact drop use drop/
    Default value: \*\*
    downloadPath
    Destination directory
    (Required) Path on the agent machine where the artifacts will be downloaded
    Default value: $(System.ArtifactsDirectory)
    cleanDestinationFolder
    Clean destination folder
    (Optional) Delete all existing files in destination folder before artifacts are downloaded
    Default value: false
    parallelizationLimit
    Parallelization limit
    (Optional) Number of files to download simultaneously
    Default value: 8
    extractTars
    Extract all files that are stored inside tar archives
    (Optional) Extract all .tar files. Enabling StoreAsTar option in PublishBuildArtifacts task will store artifacts as .tar files automatically. This option allows you to preserve Unix file permissions. Ignored on Windows.
    Default value: false

    Open source

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