question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to download an artifact published in one pipeline to another pipeline in the same project?

See original GitHub issue

Required Information

Type: Question (or Bug?)

Task Name: DownloadPipelineArtifactV2

Environment

Azure Pipelines

  • Agent - Hosted, windows-2019

Issue Description

I have 2 pipelines, both defined as YAML, in the same project. The first pipeline builds and tests the code and publishes some Python source distribution and wheel archives. The second pipeline’s job is to build some HTML docs. To do that it first needs to download the wheel archive published by the latest build in the master branch of the first pipeline.

The first pipeline has this publish task in its YAML:

    - publish: $(Build.SourcesDirectory)/dist
      displayName: Publish distribution archives to Pipeline Workspace
      artifact: 'Distribution archives'

The publishing works fine and I see a whl file appear under Artifacts/Distribution archives in the UI for a build.

The second pipeline has this step to download the whl file:

    - task: DownloadPipelineArtifact@2
      displayName: Download built distribution
      inputs:
        source: 'specific'
        project: '$(System.TeamProjectId)'
        pipeline: 288
        runVersion: 'latestFromBranch'
        runBranch: 'master'
        artifactName: 'Distribution archives'
        itemPattern: '*.whl'

I got the 288 value for pipeline from the value of definitionId in the URL for the list of builds under the first pipeline (https://dev.azure.com/<org>/<project>/_build?definitionId=288&_a=summary)

But the second pipeline fails with this error:

##[error]No builds currently exist in the build definition supplied.

What am I doing wrong please? The docs at https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-pipeline-artifact?view=azure-devops seem to be out of date (e.g., the project values are wrong in the examples). I’m also not clear whether I should even be using this task as opposed to DownloadBuildArtifacts@0 instead, and I don’t mind switching to that task if necessary.

Task logs

2020-01-15T14:45:25.3085847Z ##[debug]Evaluating condition for step: 'Download built distribution'
2020-01-15T14:45:25.3086413Z ##[debug]Evaluating: SucceededNode()
2020-01-15T14:45:25.3086488Z ##[debug]Evaluating SucceededNode:
2020-01-15T14:45:25.3086640Z ##[debug]=> True
2020-01-15T14:45:25.3086804Z ##[debug]Result: True
2020-01-15T14:45:25.3086973Z ##[section]Starting: Download built distribution
2020-01-15T14:45:25.3194004Z ==============================================================================
2020-01-15T14:45:25.3194061Z Task         : Download Pipeline Artifacts
2020-01-15T14:45:25.3194096Z Description  : Download build and pipeline artifacts
2020-01-15T14:45:25.3194828Z Version      : 2.2.0
2020-01-15T14:45:25.3194887Z Author       : Microsoft Corporation
2020-01-15T14:45:25.3194919Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/download-pipeline-artifact
2020-01-15T14:45:25.3194951Z ==============================================================================
2020-01-15T14:45:26.4494546Z ##[error]No builds currently exist in the build definition supplied.
2020-01-15T14:45:26.4501625Z ##[debug]Processed: ##vso[task.logissue type=error;]No builds currently exist in the build definition supplied.
2020-01-15T14:45:26.4502090Z ##[debug]Processed: ##vso[task.complete result=Failed;]
2020-01-15T14:45:26.4627917Z ##[debug]   at Agent.Plugins.PipelineArtifact.DownloadPipelineArtifactTaskV2_0_0.GetPipelineIdAsync(AgentTaskPluginExecutionContext context, String pipelineDefinition, String pipelineVersionToDownload, String project, String[] tagFilters, String branchName)
   at Agent.Plugins.PipelineArtifact.DownloadPipelineArtifactTaskV2_0_0.ProcessCommandInternalAsync(AgentTaskPluginExecutionContext context, CancellationToken token)
   at Agent.PluginHost.Program.Main(String[] args)
2020-01-15T14:45:26.4719823Z ##[section]Finishing: Download built distribution

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cacti77commented, Jan 20, 2020

When I added allowPartiallySucceededBuilds: true under inputs: the error “##[error]No builds currently exist in the build definition supplied” disappeared. I should’ve noted that builds of the first pipeline have only been partially succeeding (although the steps that publish the artifacts work fine).

I’ve since also changed the value for runBranch to refs/heads/master but I don’t know if that’s significant here.

0reactions
kastweycommented, Nov 15, 2021

Hi!

Is there any way to download an artefact published in another organisation, but under the same Azure Active Directory?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Download Pipeline Artifacts v2 task - Microsoft Learn
Use this task to download pipeline artifacts from earlier stages in this pipeline, or from another pipeline. Note. For more information, ...
Read more >
Download pipeline artifact from another pipeline Azure
You can either download the latest artifact of a pipeline or the artifact of a specific build of a pipeline.
Read more >
Artifacts download from one project to another project
So My user under which I'm creating the yaml pipeline task can 'read' from Project A and select the Artifacts. But then the...
Read more >
Consume artifacts from a remote DevOps project pipeline
In my DevOps organisation I have created two projects namely ProjectA and ProjectB. I also created two YAML pipelines for each corresponding ...
Read more >
Downloading Artifacts from YAML Pipelines - the urban canuk, eh
Note that if you're downloading an artifact from a different project, you'll need to adjust the authorization scope of the build agent.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found