简体   繁体   中英

Azure web job stops running

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?

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?

您可以尝试Azure Automation,它可以运行PowerShell脚本,并且可以通过计划启动

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM