所以我似乎有continuous WebJob stops automatically中描述的问题的变体。 我提供的变化是使用Basic并将网站设置为Always On。
由于网站关闭,我的webjob有时会关闭,这很好,但是webjob不会重新启动。直到我登录Azure管理门户并单击WebJobs选项卡,此时webjob才会获得" Starting"状态和时刻之后它是"运行"。
如果您看一下日志文件中的这段摘录,您可以看到在19:16:31所有三个实例都已停止(是的,网站设置为有三个实例,所以webjob也有三个实例,都很好)。它应该立即重新启动,因为网站已启动(此处未显示,但我从Azure门户获取监控数据,向我显示请求稍后发出,服务器错误为0(零))。只有当我早上登录门户网站(06:44:35)并主动选择了webjobs标签时,webjob再次启动,所有三个实例都看起来不错。
[10/15/2015 14:02:21 > c260d5: SYS INFO] WebJob is still running
[10/15/2015 19:16:17 > c260d5: SYS INFO] WebJob is stopping due to website shutting down
[10/15/2015 19:16:18 > c260d5: SYS INFO] Status changed to Stopping
[10/15/2015 19:16:22 > fe23db: SYS INFO] WebJob is stopping due to website shutting down
[10/15/2015 19:16:22 > fe23db: SYS INFO] Status changed to Stopping
[10/15/2015 19:16:22 > c260d5: SYS INFO] Status changed to Success
[10/15/2015 19:16:22 > c260d5: SYS INFO] Status changed to Stopped
[10/15/2015 19:16:25 > fe23db: SYS INFO] Status changed to Success
[10/15/2015 19:16:25 > fe23db: SYS INFO] Status changed to Stopped
[10/15/2015 19:16:29 > a81043: SYS INFO] WebJob is stopping due to website shutting down
[10/15/2015 19:16:29 > a81043: SYS INFO] Status changed to Stopping
[10/15/2015 19:16:31 > a81043: SYS INFO] Status changed to Success
[10/15/2015 19:16:31 > a81043: SYS INFO] Status changed to Stopped
[10/16/2015 06:44:35 > c260d5: SYS INFO] Status changed to Starting
[10/16/2015 06:44:50 > c260d5: SYS INFO] Run script 'webjob' with script host - 'WindowsScriptHost'
[10/16/2015 06:44:50 > c260d5: SYS INFO] Status changed to Running
[10/16/2015 06:44:53 > c260d5: INFO] Found the following functions:
[10/16/2015 06:44:53 > c260d5: INFO] WebJob.Handler.HandlePossibleJobsFromJobQueue.PossibleJobArrived
[10/16/2015 06:44:53 > c260d5: INFO] Job host started
[10/16/2015 06:44:54 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:44:54 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:44:54 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:06 > a81043: SYS INFO] Status changed to Starting
[10/16/2015 06:45:07 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:07 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:07 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:08 > a81043: SYS INFO] Run script 'webjob' with script host - 'WindowsScriptHost'
[10/16/2015 06:45:08 > a81043: SYS INFO] Status changed to Running
[10/16/2015 06:45:10 > a81043: INFO] Found the following functions:
[10/16/2015 06:45:10 > a81043: INFO] WebJob.Handler.HandlePossibleJobsFromJobQueue.PossibleJobArrived
[10/16/2015 06:45:10 > a81043: INFO] Job host started
[10/16/2015 06:45:11 > a81043: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:11 > a81043: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:11 > a81043: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:12 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:12 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:13 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:15 > fe23db: SYS INFO] Status changed to Starting
[10/16/2015 06:45:15 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:15 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:15 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:17 > fe23db: SYS INFO] Run script 'webjob' with script host - 'WindowsScriptHost'
[10/16/2015 06:45:17 > fe23db: SYS INFO] Status changed to Running
[10/16/2015 06:45:19 > fe23db: INFO] Found the following functions:
[10/16/2015 06:45:20 > fe23db: INFO] WebJob.Handler.HandlePossibleJobsFromJobQueue.PossibleJobArrived
[10/16/2015 06:45:20 > fe23db: INFO] Job host started
[10/16/2015 06:45:19 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
[10/16/2015 06:45:20 > c260d5: INFO] Executing: 'HandlePossibleJobsFromJobQueue.PossibleJobArrived' because New queue message detected on 'jobqueue'.
那为什么会这样呢?我怎样才能避免这个问题?