Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure rest API (6.0-preview.1) Run Pipeline returns : "Value cannot be null.\r\nParameter name: runParameters" via postman

I try to invoke rest API to azure via postman first, I invoke get pipelines API to get the pipeline id and the result is: 2 the response :

{
    "count": 1,
    "value": [
        {
            "_links": {
                "self": {
                    "href": "https://dev.azure.com/xxx/5fcd81ac-534e-xxx/_apis/pipelines/2?revision=3"
                },
                "web": {
                    "href": "https://dev.azure.com/xxx/5fcd81ac-534e-xxx/_build/definition?definitionId=2"
                }
            },
            "url": "https://dev.azure.com/xxx/5fcd81ac-534e-xxx/_apis/pipelines/2?revision=3",
            "id": 2,
            "revision": 3,
            "name": "xxx.ios_build_on_azure",
            "folder": "\\"
        }
    ]
}

ok assuming the id is 2 as i have only 1 pipeline there i try to invoke the runs API to start this pipeline and I'm getting this : enter image description here

{
    "$id": "1",
    "innerException": null,
    "message": "Value cannot be null.\r\nParameter name: runParameters",
    "typeName": "System.ArgumentNullException, mscorlib",
    "typeKey": "ArgumentNullException",
    "errorCode": 0,
    "eventId": 0
}

UPDATE
also if i try to add to the body : as described in : Azure REST API for running builds or pipelines

like this :

{
    "resources": {
        "repositories:" {
            "self": {
                "refName": "xxx/ios_build_on_azure"
            }
        }
    }
}

I'm getting :

{
    "$id": "1",
    "innerException": null,
    "message": "TF400898: An Internal Error Occurred. Activity Id: xxxxx-6ff6-4786-bb2e-f12dxxxx.",
    "typeName": "Newtonsoft.Json.JsonReaderException, Newtonsoft.Json",
    "typeKey": "JsonReaderException",
    "errorCode": 0,
    "eventId": 0
}
like image 560
user63898 Avatar asked Sep 03 '20 09:09

user63898


1 Answers

You may try the following content in the body:

{
    "resources": {
        "repositories": {
            "self": {
                "refName": "refs/heads/branchname"
            }
        }
    }
}

enter image description here

like image 190
Cece Dong - MSFT Avatar answered Oct 21 '22 15:10

Cece Dong - MSFT