Search code examples
azure-devopsazure-pipelines

Azure DevOps pipeline enter variable value from UI


I want user to enter value of the variable before click on Run pipeline button

I have empty variable in pipeline.yml:

- name: projectName
  value:

But UI doesn't show it:

enter image description here

How should I define var for user's input?


Solution

  • From the docs:

    You can choose which variables are allowed to be set at queue time, and which are fixed by the pipeline author. If a variable appears in the variables block of a YAML file, it's fixed and can't be overridden at queue time. To allow a variable to be set at queue time, make sure it doesn't appear in the variables block of a pipeline or job. You can set a default value in the editor, and that value can be overridden by the person queuing the pipeline.

    So, you should remove it from the YAML and define in via the UI.