I have a requirement to invoke a CURL command when a pipeline in ADO is cancelled. Can someone please let me know how i can capture cancelled status of an ADO pipeline and use that in a shellscript to invoke a CURL command.
Asked
Active
Viewed 64 times
0
-
Not get your latest information, is the workaround helpful for you? Or if you have any concern, feel free to share it here. – Hugh Lin Sep 17 '20 at 01:38
1 Answers
0
how i can capture cancelled status of an ADO pipeline and use that in a shellscript to invoke a CURL command.
You can get the execution result of the build pipeline through the rest api below:
https://dev.azure.com/{org}/{pro}/_apis/build/builds/{buildId}?api-version=5.1
Test in Postman:
Then you can write a script to get the pipeline result(e.g.$result = $response.result
), determine whether the result is canceled
, if it is, invoke a CURL command.

Hugh Lin
- 17,829
- 2
- 21
- 25