简体   繁体   English

Azure DevOps 自定义 ServiceHook

[英]Azure DevOps Custom ServiceHook

I am looking for a way to send a custom HTTP POST on service hook action.我正在寻找一种在服务挂钩操作上发送自定义 HTTP POST 的方法。 Kind of like the default WebHook functionality but with a customised body.有点像默认的 WebHook 功能,但具有自定义的主体。

Is there a way to link a custom action to the consumer event?有没有办法将自定义操作链接到消费者事件?

You can add some proxy like azure function that will reformat your message and if need call Azure DevOps rest api and also get more information, and after reformatting message you send it to final consumer.你可以添加一些像 azure 函数这样的代理来重新格式化你的消息,如果需要调用 Azure DevOps rest api 并获取更多信息,并在重新格式化消息后将其发送给最终消费者。 You can use logic app also for that.您也可以为此使用逻辑应用程序。

You can use azure logic app as suggested by @Janusz Nowak to send a custom http post on the event in azure devops.您可以按照@Janusz Nowak 的建议使用 azure 逻辑应用程序在 azure devops 中发送有关事件的自定义 http 帖子。 You can check out Quickstart: Create your first workflow by using Azure Logic Apps - Azure portal .您可以查看快速入门:使用 Azure 逻辑应用 - Azure 门户创建您的第一个工作流

After the logic app is created in your azure portal.在 Azure 门户中创建逻辑应用后。 In the L ogic app designer page choose the Blank Logic App in templates.逻辑应用程序设计器页面中,选择模板中的空白逻辑应用程序

In the search box type in azure devops and select a trigger event in azure devops.在搜索框中键入azure devops,然后在azure devops 中选择一个触发事件。

在此处输入图片说明

Then you will be prompted to authorize the logic app to connect to your azure devops.然后系统会提示您授权逻辑应用程序连接到您的 azure devops。

When you complete configuring your organization and project in the event trigger.当您在事件触发器中完成配置您的组织和项目时。 Click ** + New Step** to add a HTTP action点击** + New Step** 添加一个HTTP动作

在此处输入图片说明

You can customize your Http Request in the Http action.您可以在 Http 操作中自定义您的 Http 请求。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM