Monitoring Azure WebJobs

南楼画角 提交于 2019-12-07 02:56:40

问题


How can I monitor azure web jobs when their last run result is failed or if a continuous web job is not running?

I have found cloudmonix which does work. Are there any other products out there?

Zapier only has a zap for triggered web jobs not running continuously.


回答1:


I dont know of any other products other than CloudMonix that can monitor your Webjobs, but if all you need is alerts when a job fails, you can probably write a console program yourself that checks against your Webjobs with Azure Management certificate.

Look into IWebSiteExtensionsClient and its TriggeredWebJobs or ContinuousWebJobs properties within the Microsoft.WindowsAzure.Management.WebSites package.




回答2:


In case someone else has the same question, there is a way you can monitor Web Jobs with App Insights Web Tests.

What you need to do is to use the Kudu Web Jobs API to get the current status of the web job, e.g.

For triggered web jobs: https://{webapp-name}.scm.azurewebsites.net/api/triggeredwebjobs/{webjob-name}/

For continuous web jobs: https://{webapp-name}.scm.azurewebsites.net/api/continuousjobs/{webjob-name}/

And call the Kudu API from your App Insights Web Tests. You can configure your web tests to include the required Authorization header and to validate the JSON response. You can do this by adding multi-steps web tests.

Multi-steps web tests can be created using Visual Studio Enterprise or Ultimate, or by editing the web test xml definition directly.

You can find more details here:

https://blog.kloud.com.au/2016/08/11/monitoring-azure-web-jobs-health-with-application-insights/

HTH



来源:https://stackoverflow.com/questions/31798640/monitoring-azure-webjobs

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