I came across this Azure DevOps Task: InvokeRESTAPI@1
There is a property named 'waitForCompletion' which is designed to make an agentless job wait until it receives a callback from an external service before updating the timeline record.
Unfortunately, there are no examples in the Microsoft documentation, and I have not found any relevant wikis or articles on its usage.
Can you please provide an explanation or references?
Based on this doc: InvokeRESTAPI@1 - Invoke REST API v1 task
When you set waitForCompletion to true(Callback), it will collect the completion signal sent by external services.
Therefore you need to add the following Post callback in the external service:
Body:
You can get the parameters valueof the URL in the Invoke Rest API task(e.g. planUri):
You need to receive the request in the external service and parse the headers to obtain the corresponding parameter values.
Finally, the Invoke Rest API will get the TaskCompleted signal and check if the task is successful or failed.
Here are the resources you can refer to:
Doc: Async Http Agentless Task
Repo Project Sample: HttpRequestSampleWithoutHandler
Blog: Controlling Azure DevOps Pipelines through Teams Integration and Manual Intervention Steps and HTTP requests in YAML based pipelines