microsoft/azure-pipelines-extensions

Getting approvals from within an environment's REST handler

Opened this issue · 0 comments

I have an async REST handler set up for a DevOps environment to control when that pipeline is allowed to run using certain logic.

I used the Azure Function Basic and Advanced handler as a skeleton for creating the REST handler and it is working fine.

From within the handler, I want the approval logic to be such that only when all other approvals on the deployment have been given a go, my async handler should apply it's logic and give a go when conditions are met.

However, from the REST API's code, I have the BuildId (and more) from the DevOps's rest invocation, so I can get a BuildHttpClient and TaskHttpClient, but I can not figure out how to get to the approvals of the pipeline run to get individual approvals status.

Any thoughts on how to accomplish that?