Antares
Antares

Reputation: 3

YAML Pipeline doesn't compile Parameter: "Unexpected value" in Azure DevOps Server 2019

My first post on here, forgive me if I am at all unclear. I am a junior developer, and completely new to YAML - it's very very likely I'm missing something that someone with more experience knows about!

I am attempting to build a YAML pipeline with one boolean parameter in Azure DevOps Server 2019. However, whenever I try to run my build, I get the error message: "Could not queue the build because there were validation errors or warnings. /azure-pipelines.yml (Line: 18, Col: 3): Unexpected value 'parameters'" My parameters themselves are flagged as an unexpected value. The compiler notes: "Incorrect type. Expected "object"." I can't figure out why this happens.

Sample of my code:

#VARIABLES
variables:
BuildPlatform: 'x64'
BuildConfiguration: 'release'

#PARAMETERS
parameters:
- name: 'MATLAB-upgrade'
displayName: 'Upgrade Matlab binaries'
type: boolean
default: false

#STEPS
steps:

#NUGET RESTORE

Note on my code: the indentation that I had in YAML isn't accurately represented here, can't figure out how to make the text editor work properly. My YAML indentation IRL is set up properly.

I don't understand what this means and the documentation isn't getting me anywhere either. From what I've seen it might have to do with schemas and templates, but I can't figure out how those concepts fit into ADO YAML pipelines. It might also have to do with the version I use, Azure DevOps Server 2019, maybe certain features aren't available there yet? My variables work fine.

Many thanks for any insight.

Upvotes: 0

Views: 2801

Answers (1)

Kevin Lu-MSFT
Kevin Lu-MSFT

Reputation: 35099

"Could not queue the build because there were validation errors or warnings. /azure-pipelines.yml (Line: 18, Col: 3): Unexpected value 'parameters'" My parameters themselves are flagged as an unexpected value. The compiler notes: "Incorrect type. Expected "object"."

I can reproduce the same issue in Azure DevOps Server 2019.

enter image description here

The root cause of this issue is that the Azure DevOps Server 2019 does not support the use of parameter.

In this doc: Runtime parameters, when you select the Azure DevOps Server 2019 option, it will show the warning.

enter image description here

Upvotes: 2

Related Questions