Skip to content

Instantly share code, notes, and snippets.

@wsilveiranz
Created January 7, 2018 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wsilveiranz/f4384c0335eedc1db64c92892a9cf419 to your computer and use it in GitHub Desktop.
Save wsilveiranz/f4384c0335eedc1db64c92892a9cf419 to your computer and use it in GitHub Desktop.
Sets the state of all logic apps within a resource group.
param([string] $subscriptioname, [string] $resourcegroup, [string]$state)
Get-AzureRmSubscription -SubscriptionName $subscriptioname | Select-AzureRmSubscription
Find-AzureRmResource -ResourceGroupNameContains $resourcegroup -ResourceType Microsoft.Logic/workflows | ForEach-Object {Set-AzureRmLogicApp -ResourceGroupName $_.ResourceGroupName -Name $_.Name -State $state -Force}
@wsilveiranz
Copy link
Author

wsilveiranz commented Jan 7, 2018

Save as Set-LogicAppsState.ps1

To execute you need AzureRm module, and need to be logged as a user that have at permissions on the subscription.

Usual execution looks like this:

Login-AzureRmAccount
.\Set-LogicAppsState.ps1 "MySubscription" "MyResourceGroup" "Enabled|Disabled"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment