Azure DevOps YAML Pipeline Parameters Not Working from REST API Trigger

后端 未结 3 1476
盖世英雄少女心
盖世英雄少女心 2021-02-16 00:08

I\'m trying to create a YAML based pipeline that takes a parameter, then trigger the pipeline to run from a Azure DevOps REST API. I\'m able to see the build gets queued, but th

3条回答
  •  眼角桃花
    2021-02-16 01:02

    Got the solution after spending 2 to 3 Hour:

    https://dev.azure.com/{organization}/{project}/_apis/pipelines/2/runs?api-version=6.0-preview.1
    
       Where 2= {pipelineId}
    

    Header :

    Authorization: Personal access token. Use any value for the user name and the token as the password.
    Type: basic
    
    Content-Type : application/json
    Accept : application/json
    

    Right Now I'm using: Postman for testing this API So sharing posting main screenshot:

    In the Body part :

    {"previewRun":false,"stagesToSkip": [],"resources": {"repositories": {"self": {"refName": "refs/heads/master"}}},"templateParameters": {"testParam": "rawat Rob" },"variables": {}}
    
    previewRun :{If true, don't actually create a new run. Instead, return the final YAML document after parsing templates.}
    

    It is working for me And having test around 5 to 7 time

提交回复
热议问题