This article is contributed. See the original author and article here.
This PowerShell utility can be used to manage the Logic App runs such as cancelling or resubmitting the runs.
It supports the below operations.
- 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 attached to desired folder from here LogicAppUtility.ps1
- Set up Azure Service Principal – Contributor access on the Subscription. You can refer below doc for creating Azure app registration Create Azure SPN
- 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 copied folder in first step.
- cd ‘PowerShellScriptFolderPath’
- Execute the command to perform the different mentioned operations on Logic App.
.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 ‘Operation name‘ -StartTime ‘Enter start datetime on UTC‘ -EndTime ‘Enter end datetime in UTC’
- Validate the text file gets created in the same folder for list of run ids that are executed on specified operation.
The application /Client Id of your App Service Principal
Tenant Id of Azure AD or App Service Principal
Secret of your App Service Principal
Subscription Id where Logic App present
Resource Group Name
Resource group Name in which Logic App is present
Logic App Name
Name of your Logic App
BulkCancel – Cancel running instances
BulkResubmitFailedRuns – Resubmits failed runs
BulkResubmitCancelledRuns – Resubmits cancelled runs
BulkResubmitSucceededRuns – Resubmits Succeeded runs
If present all above operations will be performed on the runs started from the specified time.
The Timestamp must be in UTC.
You can include the EndTime along with StartTime if you want to perform above operations between specific timestamps.
It is invalid without StartTime.
Script: Download Link
- Not recommended to run directly on the Production environment
- It is tested with limited test cases and volume of runs, Validate in test environments and then perform in Production
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.