Azure LogicApp运行Webjob并发送电子邮件 [英] Azure LogicApp runs webjob and send email

查看:154
本文介绍了Azure LogicApp运行Webjob并发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个必须启动并验证webjob状态的Azure LogicApps.这是因为如果webjob以错误结束其活动,并且在这种情况下LogicApps必须发送带有警报的电子邮件并重新启动webjob,我想采取措施.

I want to create an Azure LogicApps that has to launch and verify the status of a webjob. This is because I want to take an action if the webjob finishes its activities with an error and, in this case, the LogicApps has to send an email with an alert and restart the webjob.

我试图在LogicApps网站和编辑器中找到有关它的一些文档,但是找不到任何连接器.

I have tried to find some documentation about it on LogicApps site and in the editor but I can't find any connectors.

有任何想法,文档或样本吗?谢谢

Any ideas, documentation or samples? Thank you

推荐答案

我认为我的方式可以满足您的要求.

I thought my way could meet your requirements.

您可以使用HTTP触发器通过 GET 方法获取 latest_run 属性. URI看起来类似于https://{webapp-name}.scm.azurewebsites.net/api/triggeredwebjobs/{webjob-name}/.然后单击高级选项,选择基本身份验证.您可以从发布个人资料中获取用户名和密码,也可以转到 Kudu 上的Webjobs,然后单击Properties.触发器就像图片所示.

You could use a HTTP trigger to get the latest_run property with GET method. The URI would look something like https://{webapp-name}.scm.azurewebsites.net/api/triggeredwebjobs/{webjob-name}/. Then click advanced options, choose Basic Authentication. You could get username and password from publish profile or go to Webjobs on the Kudu then click the Properties. The trigger would be like the pic shows.

然后添加一个compose动作,将HTTP Body用作Inputs.之后,您可以判断状态属性.整个流程如下图所示.

Then add a compose action, use HTTP Body as Inputs. After this , you could judge the status property. The whole flow would be like the below pic.

注意:使用条件判断状态时,需要将Designer切换到Code视图,然后更改值.该值应为"@outputs('Compose')['latest_run']['status']". ,否则您可以引用我的代码查看页面.

Note:when you use condition to judge status, you need to switch Designer to Code view, then change the value. The value should be "@outputs('Compose')['latest_run']['status']". Or you could refer my code view page.

希望这对您有帮助,如果您还有其他问题,请告诉我.

Hope this could help you , If you still have other questions, please let me know.

这篇关于Azure LogicApp运行Webjob并发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆