本文介绍了无法使用Az DevOps Pipelines API 6.0-preview.1创建新管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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
}

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

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

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

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

推荐答案

我可以在我这一边重现您的问题,并已在以下网站上报告了此问题:

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

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

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

这篇关于无法使用Az DevOps Pipelines API 6.0-preview.1创建新管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 22:33