Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create new Pipeline using Az DevOps Pipelines API 6.0-preview.1

I'm trying to create new Pipelines using this API endpoint:

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

This is the request I'm using:

curl -X POST \
  'https://dev.azure.com/<myorg>/<myproj>/_apis/pipelines?api-version=6.0-preview.1' \
  -H 'Authorization: Basic <b64string>' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
    "configuration":{
    
        "repository": {
            "id": "<repo-guid>",
            "name": "<repo-name>",
            "type": "azureReposGit"
        },
        "path": "pipeline.yaml",
        "type": "yaml"
    },
    "folder": "\\custompath\\",
    "name": "<pipelinename>"
}

I keep getting the same error:

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

It seems an issue with my payload, but documentation isn't very helpful about it https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0

Current version o nodejs sdk doesn't support the Pipeline API yet. Can anyone help me?

like image 705
Leonardo Cardoso Avatar asked Nov 07 '22 06:11

Leonardo Cardoso


1 Answers

I'm able to reproduce your issue on my side, and have reported this issue at website below:

https://developercommunity.visualstudio.com/content/problem/1101376/create-pipeline-rest-api-does-not-work.html

Product team has provided response that "A fix for this issue has been prepared. It should be released to everyone within the next 3 weeks."

like image 130
Cece Dong - MSFT Avatar answered Nov 13 '22 01:11

Cece Dong - MSFT