Developing solutions on Azure is sometimes an effortless operation. Administrate all your Azure resources that may be a different story. And this PowerShell script focuses on simplifying one of these processes.
One of the painful processes, not only when we are developing our Logic App, but mainly when we are administrating them, is finding what API Connections and no longer being used by your Logic Apps. What we call Orphaned API Connections.
What is the importance of this script? Over time, our Logic Apps can change to fit new requirements or fix some issues that can occur. And we can quickly end up with unused Azure API Connections. In addition, it is not easy to work out which API Connections are being used by our Logic Apps directly thru the Azure Portal! Neither to see if a specific API connector is orphaned.
This PowerShell script will look at all of the API Connections in your resource group and then inspect every Logic App in your resource group to check if the API Connections are being used or not. This script will help you to identify orphaned API Connections quickly.
This script was initially created by Mike Stephenson, which I took as a reference and improved or modified according to what I thought fit better to this task:
- List the output of existing API Connectors in a specific resource group to print only the API Connector name instead of the full ID to be simple to read;
- List the output of API Connectors bind to a Logic App group by each Logic App to be simple to read;
- List the output of deprecated API Connector to include only connectors are deprecated to be simple to read – this is the main point of the script. give the list of deprecated/orphaned connectors;
- Add a Deprecated tag on all the API Connectors. The reason to add this tag is that sometimes I just want to reference them and make manually double-check on the subscription, talk with the development team or make these changes (remove these API Connectors on the next intervention window, if companies have kind of this policy) :
- If it is orphaned then the value of this tag will be true;
- Otherwise, the value of this tag will be false;
- The output CSV format now includes the option for you to specify what CSV character you want to use as a separator or delimiters like comma or semicolon.
Download
THIS POWERSHELL SCRIPT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.
You can download Find Orphaned API Connectors from GitHub here: