Azure Pipeline - Why parameter value is required

Viewed 3733

Hi have a pipeline with the below parameter in the .yaml file:

parameters:
- name: Proceed
   displayName: Should we proceed
   type: boolean
   default: Yes
- name: Description
   displayName: Short description
   type: string

trigger: none

stages:
- template: sometemplate.yaml
  parameters:
    Proceed: ${{ parameters.Proceed }}
    CopySomething: ${{ parameters.Description }}

When I run the pipeline, the "Description" appears to be required even thought is not specified in the parameter. It is asking me to enter a value. I need this to be a non-required parameter and yet don't have to be set to a default value?

Thanks

2 Answers

Why parameter value is required

For this issue, currently this is by design: "# default value; if no default, then the parameter MUST be given by the user at runtime"

enter image description here

You can refer the document on github. As a workaround, agree with Krzysztof Madej, you need to set default value ''.

I think that your only option is default value ' ' like here:

parameters:
- name: Proceed
  displayName: Should we proceed
  type: boolean
  default: true
- name: Description
  displayName: Short description
  type: string
  default: ' '

trigger: none
pr: none

stages:
- template: sometemplate.yaml
  parameters:
    Proceed: ${{ parameters.Proceed }}
    CopySomething: ${{ parameters.Description }}

Be aware that yes is not valid value for boolean type.

Related