Azure LogicApp runs webjob and send email

蓝咒 提交于 2019-12-22 01:11:16

问题


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.

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


回答1:


I thought my way could meet your requirements.

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.

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.

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.



来源:https://stackoverflow.com/questions/54169693/azure-logicapp-runs-webjob-and-send-email

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!