Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax checker for Azure Pipeline YAML file

I am really annoyed by debug the syntax error by push a commit to trigger the pipeline.

Is there any azure pipeline YAML file syntax checker for intelliJ IDEA?

like image 475
SLN Avatar asked Jan 23 '26 01:01

SLN


2 Answers

There is a blogpost on how to get autocompletion in inteliJ/Webstorm etc:

https://tonybaloney.github.io/posts/azure-pipelines-autocomplete-in-pycharm.html

This is what it says:

Downloading your Schema

You can use a generic schema, like this one. However, the auto-complete will be more useful if you download your organization custom schema.

This is available from the API:

https://dev.azure.com/<YOUR ORG NAME>/_apis/distributedtask/yamlschema

Visit this URL and you’ll see a massive JSON document. Download this file and place inside your Documents folder, or any accesible directory.

yaml-schema

Telling your IDE to use the schema Inside PyCharm, IntelliJ, etc. open up your Azure Pipelines YAML file. At the bottom toolbar you’ll see a notification ‘No JSON Schema’. Click on this notification and at the top of the popup, click “New Schema Mapping”.

This opens a dialog to configure custom schema mappings.

Give it a logical name, azure-pipelines, and set the file as the schema file you downloaded in the last step. Change the Schema Version to JSON Schema version 7.

Add File Path Patterns like:

.azure-pipelines.yml
.azure-pipelines/*.yml

(or whatever matches your setup)

When you’re all done, click OK and your IDE should automatically detect any files and apply the schema.

You’ll know its working correctly when the typeahead works and the bar that said “No JSON Schema” now says “azure-pipelines”.

In future, if you install any new actions from the Azure DevOps marketplace, you’ll need to download and update the schema to get the new typeahead.

Edit: Warning

Performance seems to be very slow at the moment: https://youtrack.jetbrains.com/issue/IDEA-245648

like image 187
Michiel Avatar answered Jan 25 '26 22:01

Michiel


There is no Azure Pipelines YAML checker for intelliJ.

You can use VS Code with Azure Pipelines extension to get syntax highlighting and autocompletion for azure-pipelines.yml files.

You can also use Rest API to check your YAML, Microsfot release a new API endpoint:

POST dev.azure.com/<org>/<project>/_apis/pipelines/<pipelineId>/runs?api-version=5.1-preview

{
  "PreviewRun": true,
  "YamlOverride": "# your new YAML here, optionally"
}

Another option is to use PowerShell Module VSTeam:

Test-VSTeamYamlPipeline -PipelineId 29 -FilePath .\azure-pipelines.yml -ProjectName MyProject
like image 26
Shayki Abramczyk Avatar answered Jan 25 '26 23:01

Shayki Abramczyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!