Passing artifacts between pipelines

The DependantPipeline (which is triggered by the another pipeline: MainPipeline) causes errors on Azure DevOps:

Download Pipeline artifact
Starting: Download Pipeline artifact
Download from the specified build: #178678
Download artifact to: /agent/_work/64/Pipeline
##[error]Artifact Pipeline was not found for build 178678.
Finishing: Download Pipeline artifact

I tried to trace the file which is responsible to download artifacts in my repo, however by title I cant find it Download Pipeline artifact. Does it mean someone does not use displayName parameter and it takes that by default? Or would you give me any hint how to navigate/track files based on the output from Azure DevOps? So far by the the name works for me, not this time.

However, I found those files, which seems to be related with publishing/downloading, I hope:

take_templates.yml

steps:
  - task: DownloadPipelineArtifact@2
    displayName: "Templates from DEV"
    inputs:
      artifact: "Pipelines"
      buildType: "current"
      targetPath: "$(Pipeline.Workspace)/Pipelines"

deployment.yml

parameters:
  - name: pipelineOptions
    type: object
  - name: environment
    type: string

jobs:
  - deployment: Initializing
    displayName: "Initializing"
    environment: ${{parameters.environment}}
    strategy:
      runOnce:
        deploy:
          steps:
            - template: take_templates.yml
            - ${{ if eq(parameters.pipelineOptions.isDetectChangesEnabled, 'true') }}:
              - template: ./take_changes.yml

take_changes.yml

steps:
  - download: current
    displayName: "DetectChanges"
    artifact: DetectChanges
  - task: PowerShell@2
    displayName: "Publish Changes"
    name: "DetectChanges"
    inputs:
      targetType: "FilePath"
      filePath: take_changes.ps1
      arguments: -inputFileName './changes.json'

Currently, I have a pipeline (MainPipeline) which triggers another one (DependantPipeline), which in turns should make a deployment based on the changes, and take (as I believe) uploaded artifacts in the previous pipeline: MainPipeline, to the triggered pipeline: DependantPipeline.

EDIT 1.

I tried different combinations to stick this together based on the articles, however no no no I cant complete this

Dependant pipeline definition:

trigger: none

resources:
  repositories:
    - repository: Pipelines
      type: git
      name: Pipelines
      ref: test/pipeline
  pipelines:
    - pipeline: SourcePipeline
      project: DEV
      source: 'dev-main'
      trigger:
        branches:
          include:
                - test/pipeline
# the rest of code goes here

6

When using DownloadPipelineArtifact@2 or download tasks, the value current refers to artifacts that were published in the current pipeline, i.e. the same pipeline where these tasks are being used.

Given that your artifacts are coming from MainPipeline pipeline, you need to use different settings when using these tasks.

Example

Consider the following pipeline resource that generates an artifact named drop:

resources:
  pipelines:
  - pipeline: MainPipeline
    project: my-project
    source: my-source
    trigger: true

You can download the drop artifact as follows:

steps:
  - download: MainPipeline # as defined in the resources section
    artifact: drop # as defined in the source pipeline
    displayName: Download artifact

  # Artifacts from the associated pipeline resource are downloaded to 
  # $(Pipeline.Workspace)/<pipeline resource identifier>/<artifact name>.
  - script: |
      ls -la
    displayName: List files in artifact directory
    workingDirectory: $(Pipeline.Workspace)/MainPipeline/drop

Recommended reading

  • Publish and download pipeline artifacts
  • DownloadPipelineArtifact@2 – Download Pipeline Artifacts v2 task
  • steps.download definition

Based on the update where additional YAML templates were shared, we could see

  1. The DownloadPipelineArtifact@2 pipeline task with the displayName: "Download Templates from DEV" in take_templates.yml was defined to download the artifacts called Pipelines, which should be published during the current build due to buildType: "current", so that it could be consumed;
  2. Another download pipeline task with NO displayName property in take_changes.yml was defined to download the artifacts called DetectChanges, which should be also published during the current build due to download: current;

However, neither of the two tasks seemed to incur this error, as the message ##[error]Artifact Pipeline was not found indicated that it was downloading artifacts called Pipeline, NOT Pipelines or DetectChanges.

For this, I am afraid you will need to check if there was any other DownloadPipelineArtifact@2 or download task that was defined to consume the artifacts called Pipeline without a displayName, which should be the one affected.

In addition, we did notice the PublishPipelineArtifact@0 task in init.yml published the artifacts called Pipelines. Let’s assume init.yml was from the MainPipeline (dev-main), and you would expect to download the artifacts Pipelines during the downstream DependentPipeline.

If that was the case, the DependentPipeline should not use DownloadPipelineArtifact@2 buildType: "current" but use download: SourcePipeline instead. (SourcePipeline was the symbolic name of your pipeline resource dev-main as defined in your Dependent pipeline definition).

# Dependent pipeline definition

trigger: none

resources:
  pipelines:
    - pipeline: SourcePipeline
      project: DEV
      source: 'dev-main'
      trigger:
        branches:
          include:
            - test/pipeline

steps:
  # - task: DownloadPipelineArtifact@2
  #   displayName: "Download Templates from DEV"
  #   inputs:
  #     artifact: "Pipelines"
  #     buildType: "current"
  #     targetPath: "$(Pipeline.Workspace)/Pipelines"

  - download: SourcePipeline
    artifact: "Pipelines"
    displayName: "Download Templates from DEV"

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật