Trigger Azure Pipelines build via API

后端 未结 1 1613
灰色年华
灰色年华 2020-12-09 23:07

I made a working Azure Pipeline to build my codebase.

Looking for a way to trigger the Azure Pipelines build via API, ideally REST. If REST is not possible, perhaps

相关标签:
1条回答
  • 2020-12-10 00:04

    You can use the VSTS REST API to queue the build by giving the ID

    POST:

    https://account.visualstudio.com/project/_apis/build/builds?api-version=4.1
    

    Body

    { 
            "definition": {
                "id": number
            } 
    }
    

    Refer to this solution

    For your second question, Yes this is also possible, Just giving the parameters within the body

    Body

    {
        "parameters":  {"Parameter1":  "a value"},
        "definition":  {
                           "id":  2
                       }
    }
    

    Reference

    0 讨论(0)
提交回复
热议问题