6
votes

I created web-job and deploy it. In settings I selected web job run mode -> run continuously. And after run my webjob I catch in toggle output console next message:

[07/10/2015 16:29:48 > ef6a38: SYS INFO] Status changed to Starting [07/10/2015 16:29:48 > ef6a38: SYS WARN] 'Always On' doesn't appear to be enabled for this Web App. To ensure your continuous job doesn't stop running when the SCM host is idle for too long, consider enabling 'Always On' in the configuration settings for your Web App. Note: 'Always On' is available only in Basic, Standard and Premium modes. [07/10/2015 16:29:52 > ef6a38: SYS INFO] Run script 'OptimalyaServer.Migrations.exe' with script host - 'WindowsScriptHost' [07/10/2015 16:29:52 > ef6a38: SYS INFO] Status changed to Running [07/10/2015 16:56:13 > ef6a38: SYS INFO] WebJob is stopping due to website shutting down [07/10/2015 16:56:13 > ef6a38: SYS INFO] Status changed to Stopping [07/10/2015 16:56:18 > ef6a38: ERR ] Thread was being aborted.

I don't know why it happens and how to fix it. I would like what my web-job worked without reboot and shutdown. Help me please with this issue. Thanks

1

1 Answers

6
votes

Azure Web Apps go into a dormant state after a period of inactivity. This is useful for sites that do not have regular traffic. That is the default setting for new web apps. This is why the first request by a user against a web app that was dormant can take a few seconds longer since Azure has to "wake up" the web app.

Since your Webjob is set to run continuously, it means the webapp should never go into this dormant state. The webjob is part of the web app after all. You therefore need to configure your web app to stay "always on". It's a simply toggle in the General toggles of the CONFIGURE tab of your web app in the current management portal (right below the Web Sockets switch). In the new preview portal, click the Settings tab and then Application Settings to find the same toggle.

You can get more details on web apps configuration options at https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/.