Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to recycle app pool for a Azure web app

Is it possible to recycle app pool for websites hosted in Azure Web app. Usually website hosted on a vm or as a web role we could create a powershell script which creates ps session and recycle the app pool. Is there a similar approach we can use for Azure Web app?

like image 948
kumar Avatar asked Jan 28 '18 12:01

kumar


2 Answers

Using the Kudo console / editor you can edit the web.config file to include a comment such as the one below.

<-- Test -->

After saving this file the AppPool should recycle.

In testing this brings the application much faster than restarting the webapp through the Azure portal.

like image 156
Brett Larson Avatar answered Sep 24 '22 11:09

Brett Larson


You can use Azure PowerShell to manage Azure web apps. In your case Restart-AzureRmWebApp is the cmdlet you want to use.

The typical way to do this is to first sign in to Azure and then execute PowerShell commands:

Login-AzureRmAccount
# Only required if you need to select a specific subscription
Set-AzureRmContext -SubscriptionName "MySubscriptionName"
Restart-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoSite"
like image 25
Martin Liversage Avatar answered Sep 22 '22 11:09

Martin Liversage