Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I validate an azure-pipelines.yml file via CLI?

I'm trying to build an azure-pipelines.yml for a monorepo, and I'm struggling to figure out how to debug the file as I move along.

Is there a command such as az deployment validate ./azure-pipelines.yml available?

If so, how do you recommend I go about doing this? I keep making changes, pushing them to my repo, and then letting Azure DevOps run it, and fail.

like image 213
westandy Avatar asked Dec 12 '18 18:12

westandy


People also ask

How do you validate Azure pipeline YAML?

From within a YAML file open the Command Palette (Ctrl+Shift+P) and select the 'Azure Pipelines YAML Validator: Validate' command, alternatively use the keyboard shortcuts Ctrl+Alt+V on Windows and Ctrl+Cmd+V on Mac. Your YAML file will then be validated and any problems reported.

How do I validate Azure DevOps?

On the edit-page click on the three dots on the top right. (Optional) When using trunk based development you can choose the feature branch you are working in. In this menu, click on validate and a message will appear with either OK if the pipeline is validated correctly or an error message if the pipeline is invalid.


1 Answers

no, there is no way to validate it. when you try to run it - it will show you the error, thats the only real way to validate it.

this VSCode extension provides syntax highlighting and autocompletion.

https://marketplace.visualstudio.com/items?itemName=ms-azure-devops.azure-pipelines

like image 51
4c74356b41 Avatar answered Oct 05 '22 11:10

4c74356b41