• Home
  • About
  • Contact
  • Speaking

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

by Piotr Stapp — on azure devops 19 Mar 2019

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

$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 :)


Follow @ptrstpp950

0%
Restart, start and stop all Azure Web Apps in resource group using PowerShell
words - read.
Recent Posts:

Comments

comments powered by Disqus
Piotr Stapp Author

Piotr Stapp

Developer, engineer, craftsmen, speaker & biker. User of all useful technologies. Believe in people not papers. DevOps & automation adept. In love with web technologies. I speak here for myself only.

Previous post Running bash script in Azure DevOps on Windows machine I know that title sound ridiculous, but you know in IT sometimes strange things just happen. In my case…
Next post Azure DevOps CLI to the rescue I need to migrate a lot of repositories from one Azure DevOps to another. Migration! Don't ask why, please.…
All content copyright Reset your code © 2019 • All rights reserved.
Proudly published with Ghost