Azure Pipelines "Artifact not found for download"
A download step asked for an artifact that does not exist for this run. It was never published, the publish and download names differ, or the producing job was skipped, so there is nothing to fetch.
What this error means
The download task fails reporting the artifact was not found, naming the artifact it expected. Downstream steps that need those files then fail.
##[error]Artifact 'drop' was not found for the build.
Make sure the artifact was published by a previous job.Common causes
Artifact name mismatch or never published
The publish task's artifact:/artifactName must match the download's artifact:. A typo, or a producer that did not run, leaves nothing to download.
Producing job skipped or failed
If the job that publishes the artifact was skipped by a condition or failed before publishing, the artifact never exists for the consumer.
How to fix it
Match publish and download artifact names
Use the same artifact name in both tasks and depend on the producer.
jobs:
- job: build
steps:
- publish: \$(Build.ArtifactStagingDirectory)
artifact: drop
- job: deploy
dependsOn: build
steps:
- download: current
artifact: dropEnsure the producer runs and publishes
- Confirm the publishing job is not skipped by a condition.
- Verify the publish step succeeded before the download runs.
- Add
dependsOnso the consumer waits for the producer.
How to prevent it
- Keep publish and download artifact names identical.
- Make consumers
dependsOnthe publishing job. - Confirm the producer is not conditionally skipped when the artifact is needed.