问题
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