Listing your Logic App connections can be a hard deal. There is no tool out of the box that can do this, and it is a long process to open each one of your Logic Apps and see which connection is used.
Having dozens or hundreds of Logic Apps will make you crazy, when you want to list them.
We have created a PowerShell script that helps you with this and not only lists your connections, but also lists the Logic Apps, the Workflows available and what connections are being used and orphaned.
This is a great help for you to track which connections are broken and which are currently active and being used.
The script for Consumption Logic Apps was based on the one created by Michael Stephenson, MVP, you can check the original post and script here:
https://www.integration-playbook.io/docs/find-orphaned-api-connectors
You can also check the Tech Community blog post by Yanbo Deng, where Deng has also created a PowerShell script to list the connectors, but in a more clean and refined way. This script also allows you to delete unused connections after listing them.
Requirements for Local execution:
- Az module installed. If you have AzureRM module, you will need to remove it, else it will conflict with the Az module.
- Install Az module
https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-8.1.0
- Remove Azure RM
https://docs.microsoft.com/en-us/powershell/module/az.accounts/uninstall-azurerm?view=azps-8.1.0
- Install Azure CLI Windows
https://aka.ms/installazurecliwindows
The scripts are simple and follow a pattern.
First it will create a dictionary to insert the API connections. It will then list all the API connectors to a given Resource Group (which will be the input you will need to change to match the one you are working with). After listing the connectors, in which it will also differentiate if it's a Consumption or a Standard Managed Connector, it will seek for Logic Apps and list them and their workflows.
Having both these listings, the script will search in the Storage Account for the Connections.json file for each Logic App and output the connections. The link to the Storage Account needs a context, we cannot do it directly with the token we have from the script. Therefore, we get the Context from the Logic App and use the File Share path contained in the properties to access it.
With all this information listed, we can compare the connectors and find out which ones are actually used, and which ones are orphaned.
The Consumption oriented script is a bit different. Instead of looking for the files, it uses the Az REST command to get the Logic App content and from there, infer the connections, and compares them after that.
These scripts are designed to be executed both in Cloud PowerShell and Windows PowerShell, and the names indicate which kind of execution they are designed for. They are provided to you AS-IS and without warranty.
You can find the scripts in my GitHub repo in the following URL:
PS-Scripts---Logic-Apps-Connectors: Bundle of PS scripts to help the community. (github.com)