Howdy, developers? While deploying my Machine Learning model into Azure App Services, I faced an azure app service idle timeout issue. Although Microsoft provides the Always-On feature, that is available only for Basic and Standard service plans. The free plan does not include this feature, and we face a session timeout issue in the Azure web app service. So how can you fix the azure app service timeout after 4 minutes in a free plan?
All those whose azure app service’s always on is not working can also try these steps.
How to get Always on Azure App service for free?
Basically, it’s not possible to get this for free but there is a workaround that might do the job for you. So according to Microsoft, the Azure app service session is getting a timeout because,
By default, web apps are unloaded if they are idle for a set period of time. This way, the system can conserve resources. The downside is that the response to the first request after the web app is unloaded is longer, to allow the web app to load and start serving responses.
For the free plan, Azure App Service Always On is disabled. Follow these steps to prevent the Microsoft Azure Web App service from becoming idle.
- First of all login into your Microsoft Azure Account.
- Now click on “Create a Resource” and search for “Application Insights“.
- Now create the Application Insights resource and fill in all the necessary details.
Note: I’ve kept the resource group as same as my web app.
- Now first click on Review+Create and then click on create and wait for some time.
- After the Application Insights Resource is successfully deployed open it.
- Now click on Availability Tab inside Investigate section. Then click on “Add Classic test“.
- Now enter any name and select URL ping in SKU. Also, inside the URL input box enters the home URL of your web app.
- Now click then create and boom! You have fixed the timeout issue in the Azure app service session.
So, guys, this was it, I hope this fixes the issue and if these steps don’t work for you please drop a comment and I will try to find some other ways to fix the azure web app service idle timeout issue. Thank you and keep coding!