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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →