Reputation: 1
I am using the Task for the first time in Azure Devops.
- task: InvokeRESTAPI@1
inputs:
connectionType: 'connectedServiceName'
serviceConnection: 'Deploy'
method: 'POST'
headers: |
{
"Content-Type":"application/json",
"x-api-key": "<<>>",
"Authorization": "<<>>",
}
body: |
{
"componentId": "<<>>",
"packageVersion":"<<>>",
"shareable":"false"
}
urlSuffix: 'package/create/'
waitForCompletion: 'false'
Upvotes: 0
Views: 7018
Reputation: 76910
Pipeline in Azure Devops using Task “Invoke Rest API” is failing Error:“<>.yml (Line: 1, Col: 1): A sequence was not expected”
According to the state of the Invoke REST API task, we could to know:
Use this task in a build or release pipeline to invoke an HTTP API and parse the response.
And
The Invoke REST API task does not perform deployment actions directly. Instead, it allows you to invoke any generic HTTP REST API as part of the automated pipeline and, optionally, wait for it to be completed.
For more information about using this task, see Approvals and gates overview.
So, we could NOT use this task in the build
/release
pipeline directly. And we could search this task in the Azure devops marketplace. It always used for the Approvals and gates in the release pipeline:
To deploy the package, we could use the corresponding deployment task, like IIS Web App Deploy task, Azure App Service deploy and so on.
Hope this helps.
Upvotes: 1