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:

Set-AzureRmLogicApp -ResourceGroupName $_.ResourceGroupName -Name $_.Name -State $state -Force

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

Told you it was simple… See you next time!

Sharing is caring...

4 thoughts on “Enable/disable all logic apps in a resource group”

  1. Hi,
    Thanks for this wonderful post. But I am facing one issue when I have the integration Account linked with my Logic App.
    [ERROR]Set-AzureRmLogicApp : The integration account id must be provided in the
    [ERROR] ‘integrationAccount’ property of the workflow ‘Test_LA’.

    I have already tried with following but still getting the same error.
    Set-AzureRmLogicApp -ResourceGroupName $_.ResourceGroupName -Name $_.Name -State $state -IntegrationAccountId $integrationaccount -Force

    Could you please suggest some solution on this.


    1. Hi Desboree,

      I have to do some research on this one. I will try to look into this during the week and come back to you on it.

      Cheers, Wagner.

Leave a Reply

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