parameters:
- name: testparam
type: string
default: "default"
steps:
- script: echo hi
jobs:
- job: CallDeploymentPipeline
pool: Server
steps:
- task: InvokeRESTAPI@1
displayName: Call different-project Pipeline
inputs:
connectionType: 'connectedServiceName'
serviceConnection: "myGenericServiceConnectionName"
method: 'POST'
headers: '{ "Authorization":"Bearer $(System.AccessToken)", "Content-Type":"application/json" }'
body: '{
"resources": { "repositories": { "self": { "refName": "$(Build.SourceBranch)" } } },
"templateParameters": { "testparam": "test" }
}'
urlSuffix: '/ProjectA/_apis/pipelines/<deploy pipeline ID>/runs?api-version=7.1'
waitForCompletion: 'false'
我回来:
RESPONSE:处理请求时遇到错误。异常:{“ $ id”:“ 1”,“ Innerexception”:null,“ message”:“无法检索项目中的存储库存储库。验证所使用的名称和凭据。 teamFoundation.distributedTask.pipelines.ResourceValidationException, Microsoft.team -Foundation.distributedTask.webapi“,“ typeKey”:“ ResourceValidationException”,“ errorcode”:0,“ EventId”:3000} 异常消息:远程服务器返回一个错误:(500)内部服务器错误。 (键入WebException)如果更改以下任何一个,则可以使用此功能:
运行管道API文档 我做错了什么还是这是一个错误?
我可以复制相同的错误:
这是由于项目管道缺乏许可,请
"templateParameters": { "testparam": "test" }