How to configure Azure web Job for Always On - azure

My web job goes on sleep after a while
and as per Microsoft docs
"A web app can time out after 20 minutes of inactivity. Only requests to the scm (deployment) site or to the web app's pages in the portal reset the timer. Requests to the actual site don't reset the timer. If your app runs continuous or scheduled WebJobs, enable Always On to ensure that the WebJobs run reliably"
but I am not able to find this setting. Thats how web job looks like in portal
Can some one please help me , how can I turn on this setting

Go to the Web App that is hosting your WebJobs and select the Application Settings menu option. The Always On setting is there.
Note that Always On is only available for Basic or greater service tiers. Free and Shared do not have this setting.

Related

How to avoid azure to close inactive app service

Even if always on flas is setted, azure closes our web apps after inactivity 20 minutes. Then it opens them when first request comes. Is it possible to avoid from this behaviour. We want our services always running and responds immediately.
App service plan is Standard: 1 Large. Subscription's offer is "Azure in Open"
Thanks in advance
Go to the App Service Web App within the Azure Portal, navigate to the "Application Settings" section, and set the "Always On" option to "On". This will ensure the application is always running.
FYI, the "Application Settings" pane in the Azure Portal is changing to "Configuration", and is currently in Preview at the time of writing this.

Azure cloud web apps slows load at start

Not sure if you are experiencing the slowness of Azure cloud web apps loading at start even though AlwaysOn has been turned on.
Looking for any idea to solve this issue.
Thanks,
Riki
As a workaround, we can create a Web Job that it will continue to call our web app according to a certain period, for example, every five minutes. By this way,our application pool is never unloaded and our site is always ready to serve users.
More information about Web JOB, we can refer to: Run Background tasks with WebJobs in Azure App Service
We can create a console application and upload it to Azure as our web job program. You can find how to do it with above documentation
Update:
As you said that you have turned on "Always-On", I guess the reason for this problem is the Recycling feature of IIS Application Pool.
We can disable it with this article: Avoid automatic recycle of Azure Cloud Services Web Role

How to Pause or Stop Azure APP service in Night/Day Time when not required?

Is it possible to put app to sleep during night time anymore?
I have the app service setting NOT on "Always On", but this setting is not respected.
The bills used to be twice as much as they are now, because in past they app set itself to sleep. How do I know this? The service hours are now around 730 (that's a full month). Is Azure no more "Pay-As -You-Go?"
Thanks.
#Joonas, There was never an option to put the app to sleep in Azure Web Apps. The only way to ensure that you are not getting billed is to Scale down the corresponding App Service Plan of the web app to FREE tier.
You can configure scale settings based on a specific schedule so that the app service plan can be scaled up.
Always On is a setting used to keep your app up and running at all times. Assume that you have 10 web apps hosted on a server, out of which 8 are your dev or least used sites, while the other 2 are busy sites accessed throughout the day. In such a scenario you don't want the dev sites to be running at all times as they will hold system resources. The Always On feature is handy in such scenarios. You can set Always On to true for the 2 busy sites and false for the other 8 sites.
Check the number of App Service Plans in your subscription and
also their pricing tier. This will help you understand the costs. In
Azure App Service, you get billed for the App Service Plan and not
the Web App.
This image should help you understand App Service Plan
You can get the answer from this official FAQ:
Am I charged for apps while they are in stopped state?
Yes. Rates listed apply to apps in stopped state. Please delete apps that are not in use or update tier to Free to avoid charges.

What is a web job on azure, is it part of a web application or standalone

Is it a job attached to a web app, or is it a type of web app itself? I tried following this example but couldn't find the add webjobs link it mentioned, just links to create a web app.
https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/
Yes, a job is "attached" to a Web App. A Web App is the execution container for WebJobs. In some cases you might also have a companion website also running in the WebApp, but often, the Web App only contains WebJobs.
Once you have a Web App, you can create/manage WebJobs via the portal "WebJobs" blade in the new portal. You'll find it in the Settings blade under "Features".
Another way to think of a Web Job is as an extra .exe/process that runs on the same VM as your web app, with the only special thing being that it is launched with the same set of environment variables as the web app and has access to the same set of directories.
There's a great post here explaining WebJobs and how to create/operate one. Everything you need to know to get going.

Azure Web Job Monitoring and Alert

I have 1 web site and 3 Web jobs in one Windows Azure Web site (or Windows Azure Web App after the recent name change). I have all kinds of monitoring and alerts in place for the website but nothing for the Web Jobs at this point.
I am sure that Microsoft has the Web Job monitoring in their backlog but what is the recommended solution in the mean time?
In the last week, suddenly all the 3 web jobs stopped (scheduled to run continuously) around 4 AM early morning - it tries to restart but gets in to "pending restart" mode immediately. I am working with Microsoft support on this. But how do I send an alert once similar situation happens?
Any 3rd party extension already there to monitor the jobs?
Thanks
If third-party services are a consideration, look into CloudMonix # http://cloudmonix.com - it has tons of Azure-specific goodies for monitoring and automation and special support for monitoring of scheduled or on-demand Webjobs. It can also request kick-off of on-demand jobs. CloudMonix is a successor to AzureWatch, one of the early adaptors in Azure monitoring/auto-scaling space
HTH
Disclaimer: I'm affiliated with the company

Resources