We have a scenario where the ADO web hooks are just falling short in capabilities. I'm using the web hooks to trigger an Azure Logic App but its getting a bit over complicated with the different actions I'd need to compensate for a lot of the information that the Web hook does not have available (custom fields, dynamic project and organization names, etc)
A web hook trigger to run a build pipeline that has a custom script is unfortunately slow since the time it takes for that task to trigger would already be about 10 seconds on a good day, we'd need something to process some work item data and then trigger some API calls in 2-3 seconds from the time of the event (in this case the event is a work item getting created)
I've not included a lot of details as they're not necessary but the end-to-end process looks like this:
- Work Item Created
- Fetch Details
- If a field contains a specific value
- Make a REST API call to an external endpoint
I'd appreciate any suggestions that including only azure and azure devops products. Company policy prevent me from setting some third party service or application to fill in this gap.
You may consider using Azure DevOps WebHooks to trigger your workflow.
In addition, you may use WebHook resource to trigger pipeline that uses
InvokeRESTAPI@1
task in an agent-less job to call API request to external endpoint. Since the pipeline uses an agent-less job, it will skip the waiting time for the pipeline to pick up an agent from the pool. Here is a simple sample for your reference.Incoming WebHook
service connection the Azure DevOps project settings and take notes of the WebHook NameADOWebHook
and Service Connection NameADOWebHookSvcCnn
;ADOWebHook
and Service Connection NameADOWebHookSvcCnn
defined in theIncoming WebHook
service connection duringstep 1
;<ADO Organization Name>
with your Azure DevOps organization name and<WebHook Name>
withADOWebHook
from our example;Create WebHook event of
Work item created
; add theWebHook
URL fromstep 3
into this event to trigger this pipeline;My sample pipeline will be triggered once a new work item is created; it evaluates the value of field
System.Reason
of the newly created work item and then send API request to the external endpoint (Microsoft Teams connector message); you can customize this request sent to external endpoint with the parameter information from the event payload using the format${{ parameters.<WebhookAlias>.<JSONPath>}}
;Here is the
Test
payload of the triggering event to create a new work item;Here the output in the external service (a notification card in Microsoft Teams);