azureazure-pipelinesazure-pipelines-release-pipelineazure-devops-rest-api

Value cannot be null.\r\nParameter name: inputParameters


I am getteing "Value cannot be null.\r\nParameter name: inputParameters" while trying to create a pipeline using the azure devops REST APIs. o

Can anybody suggest what should be the request body parameters for the API Call.

My Implemetation:

API CALL (POST) : https://dev.azure.com/{org}/{project}/_apis/pipelines?api-version=6.0-preview.1

Request Body:

{
    "configuration": [
        {
            "type": "yaml",
            "folder": "./",
            "name": "trl-pipeline"
        }
    ]
}

as per https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0

Response:

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

Solution

  • Please add repository id and name in your request body. Here is my sample:

    1.I created a yaml file in my azure repos.

    enter image description here

    2.My request body looks like this:

    POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1
    
    
    
    {
            "configuration":{
                "path": "azure-pipelines.yml",
                "repository":{
                    "id": "{repo id}",
                    "type": "azureReposGit",
                    "name": "{repo name}"
                },
                "type":"yaml"
            },
            "name":"PipelineName"   
        }