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