Understanding Spaces and Indentation in Azure DevOps YAML Pipelines
When working with Azure DevOps YAML pipelines , one of the most important concepts to understand is indentation . Unlike programming languages that use braces ( {} ) or brackets ( [] ) to define structure, YAML relies entirely on spaces to represent hierarchy. Even a small indentation mistake can completely change how Azure DevOps interprets your pipeline. Why Indentation Matters Azure DevOps uses indentation to determine: Parent-child relationships between pipeline sections Which properties belong to an object Which items belong to a list/collection In simple terms: Indentation defines structure in YAML Basic Rule Use consistent spaces to nest child elements under parent elements. Recommended standard: Use 2 spaces per indentation level Never use tabs Correct Indentation Example pool: vmImage: ubuntu-latest What This Means pool is the parent object vmImage is a property inside pool Equivalent JSON: { "pool": { "vmImage": "ubuntu-latest" } ...