How can I keep Azure web app always on during a certain time of the day

savemightlife 26 Reputation points
2020-10-17T06:49:01.427+00:00

Hi, How can I turn on the ALWAYS ON option in Azure web app.
However, I only need it to be ALWAYS ON from 11am-11pm.
I don't need it to be always on 24 hours.
How can I do this ?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,960 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. sadomovalex 3,636 Reputation points
    2020-10-19T15:13:00.103+00:00

    AlwaysOn doesn't have period of time: it is web app-scope setting and may be on or off. However you may develop PowerShell script which runs by scheduler and set's AlwaysOn to On and Off at specified times of the day: see e.g. Azure: Powershell: Set-AzureRmWebApp: How to set the “alwaysOn” property.

    2 people found this answer helpful.
    0 comments No comments

  2. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2020-10-19T10:57:57.953+00:00

    Thanks for asking question! For Always On feature of Azure App Service, keeps the host process running. This allows your site to be more responsive to request after significant idle periods. Otherwise, once a request comes in, the App Service will have to cold boot and load into memory before responding to the request.

    Always On: Keeps the app loaded even when there's no traffic and It's required for continuous WebJobs or for WebJobs that are triggered using a CRON expression.

    To add to it this means your app stays loaded in memory, vs being aged out (which prevents long delays when a user first visits after the app's cache has expired). It's not related to the allocated Web App resources being deployed.

    In Basic and Standard service plans, you can turn on the Always On setting to keep the app always loaded. To change the Always On setting:

    In the Azure portal, go to your web app.

    1. Select Configuration.
    2. Select General settings.
    3. For Always On, select On.

    Also, could you please elaborate on what is your idea behind scheduling Always On for a certain time of the day to help you better on this.

    Reference: https://learn.microsoft.com/en-us/azure/app-service/configure-common
    https://learn.microsoft.com/en-us/azure/app-service/faq-availability-performance-application-issues

    Looking forward to help you on this.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.