This PowerShell utility helps you to perform bulk operations on the Consumption Logic App runs. And below are the supported operations with this utility.
- BulkCancel - Cancel running instances
- BulkResubmitFailedRuns - Resubmits failed runs
- BulkResubmitCancelledRuns - Resubmits cancelled runs
- BulkResubmitSucceededRuns - Resubmits Succeeded runs
Steps to follow for executing the script:
-
Copy the PowerShell script to the desired folder
-
Ignore this step if your using user creds to login. If not, proceed with creating App registration either from portal or using CLI command as in below blog.
Set up Azure Service Principal - Contributor access on the Subscription. https://blog.jongallant.com/2017/11/azure-rest-apis-postman/
-
Open PowerShell with 'Run As administrator Privileges'
-
Run the below command to bypass the execution policy and accept -Y
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
-
Change the directory to the PowerShell script folder where its available.
cd 'PowerShellScriptFolderPath'
-
Execute one of the below commands to perform the specified bulk operation on Conusmption Logic App.
To Log-in with user credentials:
.\LogicAppUtility.ps1 -SubscriptionId 'Enter Subscription Id' -ResourceGroupName 'Enter resource Group Name' -LogicAppName 'Enter Logic App Name' -Operation 'OperationName' -StartTime '2020-11-02T16:33:00.000Z' -EndTime '2020-11-02T16:38:00.000Z’
To authenticate with App registration details:
.\LogicAppUtility.ps1 -ClientId 'Enter ClientId' -TenantId 'Enter TenantId' -Secret 'Enter Secret' -SubscriptionId 'Enter Subscription Id' -ResourceGroupName 'Enter resource Group Name' -LogicAppName 'Enter Logic App Name' -Operation 'OperationName' -StartTime '2020-11-02T16:33:00.000Z' -EndTime '2020-11-02T16:38:00.000Z’
- Log file gets generated in the script folder with the Run ids and their Start time, you may use these to cross verify the operation in the portal.
Parameters definition:
Note:
-
Not recommended to run directly on the Production environment
-
It is tested with limited test cases and volume of runs, validate this in test environment prior to execute in Production.