2021年3月7日星期日

How to trigger my "Incoming Webhook" Service Connection in Azure DevOps (OnPremise)? The Endpoint URL is unknown

Overview: I try to trigger an Azure DevOps 2020 Pipeline (YAML) in the event that a WorkItem of a specific type is created. So my idea I had was to create a connection between "WorkItem" -> Service Hook of Type "Web Hook" -> Service Connection of Type "Incoming Webhook" -> resource:webhook triggers the Pipeline in YAML.

My problem now is, that I could create the serviceendpoint by GUI or by API, but the documentation and the created endpoint does not make sense for me. I am running my server on-premise and the endpoint I got looks like this:

{"count":1,"value":[{"data":{},"id":"1babbef7-1edb-4b01-bf18-b6e3c309caae","name":"TestIncomingWebhook","type":"incomingwebhook","url":"https://dev.azure.com", ...  

The url does not make sense to me.

I can alter the url if I use the REST API to create the endpoint by using this format

POST https://{instance}/{collection}/{project}/_apis/serviceendpoint/endpoints  

as described in Microsoft Azure API Documentation.

Questions:

  1. Why is the url that the service connection gets pointed to https://dev.azure.com while I am running on-premise from a server on a totally different url? Would that be the url I have to POST to trigger the ServiceConnection?
  2. What must be the correct URL-Format for my local Server? Where should I point that URL to?
  3. How can I trigger the Service Connection from curl? Do I have to use GET with a lot of parameters or POST with a JSON payload?

I would appreciate if someone could help me out on this. Perhaps someone even got a full solution on how to trigger pipelines on workitem events. I searched a lot but could not find a solution, yet.

Thanks, Peter.

https://stackoverflow.com/questions/66496124/how-to-trigger-my-incoming-webhook-service-connection-in-azure-devops-onpremi March 06, 2021 at 12:26AM

没有评论:

发表评论