Skip to content
Latchkey

Azure Pipelines YAML Schema "Unexpected value X"

The YAML parsed fine, but a key appears where the pipeline schema does not expect it - a property misspelled, placed under the wrong parent, or indented one level off. The compiler rejects the unexpected value.

What this error means

The run fails with Unexpected value '<key>' at a line/column. The document is valid YAML; the structure violates the pipeline schema for that position.

azure-pipelines
/azure-pipelines.yml (Line: 9, Col: 5): Unexpected value 'step'

Common causes

Property under the wrong parent

Keys are schema-scoped. A steps: entry written as step:, or a job-level key placed under pool:, lands where the schema does not allow it.

Misspelled or misindented key

A typo (scripts: for script:) or an indent that moves a key under a sibling it should not nest in triggers an unexpected-value error.

How to fix it

Place keys under the correct parent

Use the exact schema key and nest it where the schema expects.

azure-pipelines.yml
jobs:
  - job: build
    steps:
      - script: echo build   # 'steps:' is a list of step objects

Check the key against the schema

  1. Compare the flagged key to the Azure Pipelines YAML schema for that context.
  2. Fix spelling and move the key under its correct parent.
  3. Re-validate so no other unexpected values remain.

How to prevent it

  • Reference the YAML schema when adding unfamiliar keys.
  • Keep indentation aligned so keys nest under the intended parent.
  • Validate the pipeline after structural edits.

Related guides

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