Lesstep
Azure Pipelines · artifacts · Checked November 10, 2026

Azure Pipelines: "Artifact ... already exists for build ..."

The publish step failed because the run already has an artifact with that name. It usually shows up when you rerun a failed job or stage: the rerun belongs to the same run (the build number in the message), and the first attempt had already published, often test results or logs published with condition: always(). In the log it looks like ##[error]Artifact Linux_Linux TestResults already exists for build 3078020. (dotnet/efcore #39005).

Three ways out

FixIn the YAMLWatch for
A name per attemptartifact: TestResults_$(System.JobAttempt)A later job that downloads TestResults by its fixed name
Publish only on successLeave the publish step on the default condition, at the end of the jobLogs from a failed attempt are not kept as an artifact
Run the pipeline againNo change: queue a new run instead of rerunning the failed jobsEvery job runs again, not only the failed one

System.JobAttempt is 1 the first time a job runs and goes up by one each time the job is retried (predefined variables). The .NET teams fixed this error by adding it to their test-result artifact names (dotnet/efcore #39048, dotnet/aspnetcore #56897).

When the job is a pull request's build validation: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, lists the pull request's branch policies with their state in IntelliJ IDEA, Rider or PyCharm, and with Pro queues a failed build policy again as a new run, from the IDE. Its Pipelines tab (version 1.0.86 and later) lists the runs of the repositories you have open and opens a failed task's log in the editor, free to read.

Where it comes from

Downloading a name with the attempt in it

- download: current
  patterns: 'TestResults_*/**'

Without an artifact name, the download step takes every artifact of the run, each in its own folder, and the patterns start with the artifact name, so this picks up every attempt. For one attempt only, use the full name, for example TestResults_1.

Similar pages

Azure DevOps pull requests in IntelliJ IDEA, Rider and PyCharm

Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It shows the branch policies of a pull request with their state, so a required build that has not passed is next to its pull request, and with Pro you run a failed or expired build policy again from there. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial.

Get it on JetBrains Marketplace

Azure DevOps and Azure Pipelines are trademarks of Microsoft Corporation; IntelliJ IDEA, Rider and PyCharm are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.

More: Not found PathtoPublish · We stopped hearing from agent · Build validation · 日本語