Visual Studio Code showing error: Property Stages is not allowed, Property parameters is not allowed

Viewed 1786

I created reusable templates from Azure DevOps yaml pipeline. The build.yaml you see below is one such template.

When I push code, the pipeline successfully runs on Azure DevOps without complaining. However Visual Studio Code complains as I hover on parameters or stages.

Property Stages is not allowed 
Property parameters is not allowed

Am I missing any settings here? Why VS Code shows errors while azure devops runs the same successfully?

Property parameters is not allowed error shown by VS Code

Property stages is not allowed error shown by VS Code

And interestingly, I have another template in the same directory, which does not show any such error messages. What am I missing? I restarted vs code, still same.

VS Code showing no error with another yaml azure devops template

1 Answers

I observed this problem with both Visual Studio Code as well as Visual Studio 2022 Preview.

This lead me to think, I renamed the file build.yaml to build-stage.yaml. This fixed the issue finally. May be build is some keyword kind of thing internally.

Related