问题
I have a a WebJob project developed in .NET C#, which I deploy on Azure through Visual Studio 2015. The WebJob is scheduled with CRON "0 0 7 1 * *" (to run at 1st day of the every month at 7am) on the settings.job file. After it is deployed and running, on the log keep getting the singleton lock message every 30 seconds:
"[11/02/2016 20:29:52 > 21cce2: INFO] Renewing Singleton lock....."
So everything looks good, but after couple of hours the webjob gets automatically aborted on Azure Portal, without doing any changes to the web app or the webjob itself.
What can be the reason and how can I avoid this with C# ?
回答1:
the web app is always on.
Does it mean that Always On is turned on in Azure Portal? By default, it is turned off. If we don’t turn it Always On, WebJob may abort in idle for some period of time. Web apps are unloaded if they are idle for some period of time. This lets the system conserve resources. Please have a try to set Always On to keep the app loaded all the time. More please refer to the screenshot.
If the Always On is turned on, and always get the WebJob aborted ,please have a try to install Crash Diagnoser to catch crashed info. More info about Crash Diagnoser,please refer to link.
来源:https://stackoverflow.com/questions/40389362/azure-webjob-automatically-gets-aborted