Azure Pipelines "Stage name must be unique" Error
Two stages (or jobs) share the same identifier, but Azure Pipelines requires names to be unique so the dependency graph is unambiguous.
What this error means
Validation fails with a message that a stage or job name appears more than once, naming the duplicate.
azure-pipelines
Stage name test appears more than once. Stage names must be unique.Common causes
Copy-pasted stage/job
A duplicated block kept the same name.
Template injects a clashing name
An included template defines a stage/job with a name already used.
How to fix it
Give each stage and job a unique name
- Rename the duplicate stage or job.
- Update any dependsOn references to the renamed identifier.
azure-pipelines.yml
stages:
- stage: test_unit
- stage: test_integrationHow to prevent it
- Use distinct, descriptive names and parameterize template stage names so includes do not collide.
Related guides
Azure Pipelines "dependsOn" Stage or Job Not FoundFix the Azure Pipelines error where a stage or job dependsOn references a name that does not exist, breaking…
Azure Pipelines YAML Schema Validation ErrorFix the Azure Pipelines "azure-pipelines.yml schema validation" error where the YAML uses an unknown property…
Azure Pipelines "Template file could not be found"Fix the Azure Pipelines "template file X could not be found" error caused by a wrong path or a missing reposi…