Category Archives: Azure

Validating Azure DevOps YAML pipeline locally

Today my colleague asked me how to validate Azure pipeline without committing changes to repo and trying to run pipeline. There is a VS Code Azure Pipelines YAML Validator plugin, but it does not work for YAML files which reference template files. In this scenario (validation of YAML files which reference template files) you can perform local validation using VSTeam PowerShell module, see details on using this approach below.

Output of Test-VSTeamYamlPipeline returns Name / URL / state / Id and state = unknown with Id = -1 means that no validation errors were found:

If validation errors will be found it will return error text with validation error details – you will see the same errors as if you would try to run this pipeline – such things as missing required parameter(s) or unknown parameter(s) will be reported.