Azure Pipelines PublishPipelineArtifact / DownloadPipelineArtifact Name Mismatch
A DownloadPipelineArtifact@2 could not find the artifact it asked for. The artifact name does not match what PublishPipelineArtifact@1 produced, or a cross-stage download lacks a dependency on the stage that published it.
What this error means
The download step fails with "artifact not found" (or downloads nothing), so the consuming step has no files. The publish step earlier in the run succeeded - the names or stage wiring just do not line up.
##[error]Artifact 'web-dist' was not found for the pipeline run.
Published artifacts: 'drop'.Common causes
Download name differs from the published name
The artifact input on download must exactly match the artifact used on publish. A mismatch (web-dist vs drop) returns nothing.
Cross-stage download without the dependency
Downloading an artifact published in another stage requires the consuming stage to dependsOn the producing stage, or the artifact is not visible yet.
How to fix it
Match published and downloaded artifact names
Use the same artifact name on both ends.
# producer
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'web-dist'
# consumer
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'web-dist'
path: '$(Pipeline.Workspace)/web-dist'Add the stage dependency for cross-stage downloads
Make the consuming stage depend on the producing stage so the artifact is available.
- stage: Deploy
dependsOn: Build
jobs:
- job: pull
steps:
- download: current
artifact: web-distHow to prevent it
- Keep one canonical artifact name and reference it on both publish and download.
- Add
dependsOnwhenever a stage consumes another stage’s artifact. - Use the
download:shortcut withcurrentto pull this run’s artifacts.