I’m trying to provide user input during pipeline runtime but not able to give it. is there any way I can achieve this in azure pipeline apart from using parameters or using key vault to provide the input during manual validation.
Tried creating an ansible task to prompt the user to enter the input but not able to achieve it.
2
Answers
Azure DevOps build pipelines are non-interactive, and there is no way to ask for user input during a pipeline run, unless you are using manual intervention and changing data in third party storage areas/vault like you suggest.
You can suggest the feature here, and it may get developed.
Since Azure Pipelines are non-interactive, there is no way out-of-the-box to input variable values during a pipeline run.
While inspired by @ScottRichards insightful answer, you may consider using the workaround below to update the values of the variables from pipelines library (variable group) during the process of a running pipeline.
Here is a simple YAML pipeline to use a variable group (in the
job
scope).VG-Job
; in the variable group, add a variable$(Var1)
with the original valueValueXXXXX
;Approvals
check for this variable group;StageA
to wait for the approval by the approver to use the variable group resourceVG-Job
;$(Var1)
in this variable group and proceed to approve and resume the pipeline stage;$(Var1)
during the pipeline run will be the updated valueValueYYYYY
rather than its original valueValueXXXXX
, since the value of a variable in a variable group is processed at runtime;Kindly be also advised that,
This is to say for
Job2
in the same stage as that ofJob1
, it will not suspend the pipeline again to ask for approval.Hope the workaround may help resolve your queries.