Skip to content
Latchkey

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

  1. Rename the duplicate stage or job.
  2. Update any dependsOn references to the renamed identifier.
azure-pipelines.yml
stages:
  - stage: test_unit
  - stage: test_integration

How to prevent it

  • Use distinct, descriptive names and parameterize template stage names so includes do not collide.

Frequently asked questions

What causes ""Stage name X appears more than once""?
A duplicated block kept the same name.
How do I fix "Stage name X appears more than once"?
Give each stage and job a unique name

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card