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

前提是你 提交于 2021-01-27 05:46:08

问题


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://docs.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?


回答1:


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



来源:https://stackoverflow.com/questions/62699025/cannot-create-new-pipeline-using-az-devops-pipelines-api-6-0-preview-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!