Azure web job stops running

江枫思渺然 提交于 2019-12-13 07:08:07

问题


I have a PowerShell script that runs every 5 minutes via the Web Job functionality of a Web App. Along with the Powershell script I have a settings.job with the following config, which is what makes it tick rather than configuring it as part of the Web job setup:

{
    "schedule": "0 */5 * * * *"
}

The job runs successfully each 5 mins for a few hours, but i notice each morning that is has stopped. I'm thinking maybe as a result of an IIS Recycle (?) the job is stopping and then I have to manually kick it off again.

How do I keep it always running?


回答1:


From the documentation under "Create a scheduled WebJob using a CRON expression":

This technique is available to Web Apps running in Basic, Standard or Premium mode, and requires the Always On setting to be enabled on the app.

Can you check whether your Web App is using Always On?




回答2:


You might try Azure Automation it can run PowerShell scripts and can be kicked off via a Schedule



来源:https://stackoverflow.com/questions/37376002/azure-web-job-stops-running

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