无法使用Az DevOps Pipelines API 6.0-preview.1创建新管道

时间:2020-07-02 14:47:08

标签: api rest azure-devops azure-pipelines

我正在尝试使用此API端点创建新的管道:

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

这是我正在使用的请求:

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>"
}

我不断收到相同的错误:

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

我的有效负载似乎有问题,但是文档对此并没有太大帮助 https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0

当前版本o nodejs sdk尚不支持Pipeline API。谁能帮我吗?

1 个答案:

答案 0 :(得分:1)

我可以单方面复制您的问题,并已在以下网站上报告了此问题:

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

产品团队提供的答复是,已准备好此问题的修复程序。应在接下来的3周内将其发布给所有人。