In my Azure Devops Pipeline, I'm using InvokeRESTAPI@1
to trigger another Devops Pipeline by POSTing to the pipeline run endpoint documented here.
This used to work, but as of August 4 2023 I'm getting a 500 error when this pipeline runs. I can still call successfully from Postman using the same PAT credentials. I also upgraded from api v6.0-preview
to v7.0
with no difference.
I've seen a couple of Q&A's reporting similar 500 errors, but those were due to some issue from either the calling side or the pipeline being called, which is not the case here.
Pipeline code:
- task: InvokeRESTAPI@1
displayName: Call Pipeline 2
inputs:
connectionType: 'connectedServiceName'
serviceConnection: "<My Service Connection (using PAT)>"
method: 'POST'
body: '{
"resources": { "repositories": { "self": { "refName": "refs/heads/$(Build.SourceBranchName)" } } },
"templateParameters": { "boolParam": true, "stringParam": "stringVal" }
}'
urlSuffix: '/ProjectName/_apis/pipelines/${{parameters.pipelineId}}/runs?api-version=7.0'
waitForCompletion: 'false'