Run Pipeline Rest API - execute with branch name

Vennila V 1 Reputation point
2021-07-30T13:31:55.38+00:00

In our project, we are triggering pipeline through Runs REST API, following the steps mentioned in this page - https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run%20pipeline?view=azure-devops-rest-6.0 .
Now, we created the pipelines in feature branch and tried to invoke using the above API, we are getting below exception.

{
"$id": "1",
"innerException": null,
"message": "An error occurred while loading the YAML build pipeline. File /delete.yml not found in repository https://dev.azure.com/{}/{}/_git/{} branch refs/heads/master version 201d2723d992a6ce0575838046970367098296a.",
"typeName": "Microsoft.Azure.Pipelines.WebApi.PipelineValidationException, Microsoft.Azure.Pipelines.WebApi",
"typeKey": "PipelineValidationException",
"errorCode": 0,
"eventId": 3000
}

When we add the pipeline yml file in master branch, we are able to trigger it using the API. But if we should not use the master branch, and use a different branch, how we can pass the branch parameter in this API call? Please suggest.

Community Center | Not monitored
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. tbgangav-MSFT 10,426 Reputation points Moderator
    2021-07-30T13:59:46.14+00:00

    Hi @Vennila V ,

    Azure DevOps is currently not supported in this Microsoft Q&A platform. You may ask Azure DevOps related questions in this developer community.


  2. ab-oe 6 Reputation points
    2022-12-08T11:44:41.81+00:00

    Did you found out the solution? I am facing the same issue.

    0 comments No comments

  3. Ray Depew 36 Reputation points
    2023-05-26T15:48:30.17+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.