user3417479
user3417479

Reputation: 1910

Trigger Azure Pipeline during PR with parameters

I have a pipeline in Azure DevOps which requires the parameter libName. The pipeline starts like this:

name: ${{ parameters.libName }}
trigger: none
pr: none

When I start the pipeline manually, a dialog box appears where I can provide the libName. So far so good.

However, I want to trigger this pipeline when I create a Pull Request. In that case I receive an error

A value for the 'libName' parameter must be provided.

Is there a way to provide this parameter when I create the PR?

Upvotes: 3

Views: 1712

Answers (1)

Kim Xu-MSFT
Kim Xu-MSFT

Reputation: 2196

It is currently not supported to pass parameter along with the Pull Request.

If you want to define a specific value for parameter, you must manually trigger this pipeline and put in the value.

For PR trigger, you are not allowed to define the parameter value automatically, try adding some default value for it.

To fix this error:

A value for the 'libName' parameter must be provided.

You could provide a default value for your parameter. For example:

parameters: 
- name: libName 
  default: some library

Refer to this official doc for details: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/runtime-parameters?view=azure-devops&tabs=script

Upvotes: 3

Related Questions