microsoft / azure-pipelines-extensions

Collection of all RM and deployment extensions
http://www.visualstudio.com/explore/release-management-vs
MIT License
275 stars 425 forks source link

Getting approvals from within an environment's REST handler #1201

Open pallibj opened 8 months ago

pallibj commented 8 months ago

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?