Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Web Job always on

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

like image 440
Taras Kovalenko Avatar asked Jul 10 '15 17:07

Taras Kovalenko


People also ask

What is always on setting in Azure?

The Always On feature keeps your Azure web applications up and running, which translates to higher availability and faster response times across the board. The feature it's required for continuous Azure WebJobs or WebJobs triggered by CRON expressions.

Which Azure websites feature should you enable for continuously running WebJobs?

If you set the web app that hosts your job to run continuously, run on a schedule, or use event-driven triggers, enable the Always on setting on your web app's Azure Configuration page. The Always on setting helps to make sure that these kinds of WebJobs run reliably.

How do I increase the timeout on my Azure Web App?

1 Answer. As you are aware, the 230 seconds is a timeout configured at the Azure App service load balancer. This is a part of the Azure App service architecture and cannot be configured or changed.

How do I monitor my Azure web job?

You can monitor Web Jobs using 3rd party tool like CloudMonix or App Insights Web Tests(it is a part of Azure Monitor). With App Insights Web Tests you need Kudu Web Jobs API to get the current status of the web job, e.g. Call the Kudu API from your App Insights Web Tests.


1 Answers

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/.

like image 74
ActiveNick Avatar answered Oct 21 '22 04:10

ActiveNick