Azure Logic Apps (Consumption) charge per execution, but even inactive ones can still cost money. Triggers like polling or timers may continue to run, leading to hidden costs. Cleaning up unused Logic Apps improves governance and supports FinOps goals.
What Counts as an Unused Logic App?
In this context, a Logic App is considered unused if it has zero executions recorded. That usually means:
- It was never triggered
- It’s no longer part of any active integration
- Or it’s quietly polling on a timer or HTTP without producing runs
These apps can still generate costs, consume logging and trigger resources, and clutter your environment.
PowerShell Script: Detect Unused Azure Logic App (Consumption) Workflows
The following script:
- Connects to Azure
- Queries all Logic App workflows in the current subscription
- Calls the REST API to count executions
- Lists only those with zero runs
PowerShell
# Log in and set context
Connect-AzAccount
# Get current subscription
$subscription = Get-AzContext | Select-Object -ExpandProperty Subscription
Write-Host "Using subscription: $($subscription.Name) ($($subscription.Id))"
# Get all Logic App Consumption workflows
$logicApps = Search-AzGraph -First 1000 -Query @"
Resources
| where type == 'microsoft.logic/workflows'
| where subscriptionId == '$($subscription.Id)'
| project name, location, resourceGroup, id, tags
"@
if (-not $logicApps) {
Write-Host "No Logic App Consumption workflows found."
return
}
Write-Host "Found $($logicApps.Count) Logic Apps. Gathering run counts..."
# Prepare output collection
$results = @()
foreach ($logicApp in $logicApps) {
$name = $logicApp.name
$rg = $logicApp.resourceGroup
$tags = $logicApps.tags
$apiVersion = "2016-06-01"
$url = "https://management.azure.com/subscriptions/$($subscription.Id)/resourceGroups/$rg/providers/Microsoft.Logic/workflows/$name/runs?api-version=$apiVersion"
$secureToken = (Get-AzAccessToken).Token
$token = [System.Net.NetworkCredential]::new("", $secureToken).Password
$headers = @{ Authorization = "Bearer $token" }
$response = Invoke-RestMethod -Method Get -Uri $url -Headers $headers
$runCount = $response.value.Count
if ($runCount -eq 0) {
$results += [PSCustomObject]@{
Name = $name
ResourceGroup = $rg
Runs = $runCount
Tags = $tags
}
}
}
# Output unused Logic Apps
$results | Format-Table -AutoSizeOutput Example
PowerShell
Name ResourceGroup Runs Tags
---- -------------- ---- ----
logicapp-old-test rg-archive 0 env=dev;owner=integration
logicapp-dev-temp rg-poc 0 env=dev;owner=testerConclusion
Unused Logic Apps can still generate costs if triggers are active. Identifying and removing them helps reduce waste, simplify monitoring, and align with cloud cost management practices.
