kumar
kumar

Reputation: 9387

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?

Upvotes: 5

Views: 8594

Answers (2)

Brett Larson
Brett Larson

Reputation: 161

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.

Upvotes: 6

Martin Liversage
Martin Liversage

Reputation: 106836

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"

Upvotes: 3

Related Questions