Using artifact in one pipeline in the another pipeline- Azure DevOps

Shyam Kumar 846 Reputation points
2025-04-22T17:14:32.3566667+00:00

I have below published artifact and download artifact in one pipeline for different stages,

I want to use published artifact in another pipeline as I am moving another stage to 2nd new pipeline.

User's image

Please suggest how it can be done?

Azure DevOps
0 comments No comments
{count} vote

Accepted answer
  1. Divyesh Govaerdhanan 6,235 Reputation points
    2025-04-22T18:31:25.4333333+00:00

    Hello,

    Welcome to Microsoft Q&A,

    You can use resources: pipelines to Consume It

    You need to declare a pipeline resource that references first Pipeline:

    https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/download-pipeline-artifact-v2?view=azure-pipelines

    resources:
      pipelines:
        - pipeline: pipelineA      # alias you’ll use in this pipeline
          source: 'Your-Pipeline-A-Name'
          project: 'YourProjectName'       # optional if same project
          trigger:
            branches:
              include:
                - main             # or the branch you build on
          artifact: drop           # name of the artifact to use
    
    stages:
      - stage: UseArtifact
        jobs:
          - job: DownloadAndUse
            steps:
              - download: pipelineA
                artifact: drop
    
              - script: |
                  echo "Listing files from artifact"
                  dir $(Pipeline.Workspace)/drop
    
    
    

    Please Upvote and Accept the answer if it helps!!

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.