Enable/disable all logic apps in a resource group

Have you ever wanted to stop all logic apps in a resource group in one go – either for production maintenance, or maybe because that set of logic apps in a resource group is eating all your resources? If so, welcome to the club… What you probably found is that there is no way to do this in the portal. Coming from a BizTalk background where you can stop all orchestration – or even the whole application) with a right click, in some cases you will ask “Why?”, while in others you might shout “Khaaaannn!” (I know I probably did both).In those situations, powershell is your friend! And it is not too difficult… I created a script for that some time ago, before the blog was created and almost forgot about it – although I hunt it down again every time that I need to do maintenance on some of my applications. Then a post in the Logic Apps MSDN forum reminded me that I haven’t posted that solution yet. So here it go. You can find it in this gist (with some comments on usage), if you want to download.

If you follow the blog, you probably saw some of this code before, as I used it to loop through all logic apps in a resource group when I was extracting the logic apps templates – actually this code gave me the idea to do the same on that case.

One you have a list of logic apps, the only thing you need to do is to set the correct state using this command:

Where $state is either “Enabled” or “Disabled”

Told you it was simple… See you next time!


Sharing is caring...

One thought on “Enable/disable all logic apps in a resource group”

Leave a Reply

Your email address will not be published. Required fields are marked *