Home Restart, start and stop all Azure Web Apps in resource group using PowerShell
Post
Cancel

Restart, start and stop all Azure Web Apps in resource group using PowerShell

This post is short but useful. We need just two lines (we can combine it to one):

1
2
$allSites = Get-AzureRmWebApp -ResourceGroupName resource-group-name
@($allSites).GetEnumerator() | Restart-AzureRmWebApp

The trick is to use GetEnumerator() because above commandlet returns System.Collections.Generic.List instead of array of individual objects into pipeline.

This also works with Stop-AzureRmWebApp and Start-AzureRmWebApp.

Simple, fast and useful. What we need more :)

This post is licensed under CC BY 4.0 by the author.