Highlight

Why it happens and how to solve orphaned API connections for azure logic apps?

Intro

This is probably one of the most common issues I see that clients have with logic apps. They develop logic apps, and after half a year they have dozens of connections in their resoruce group, often tens for each connector they use and the amount of connections varies between environments. So let’s talk about, why is this happening.

What is orphanned connection?

Orphanned connection is simply an Azure Resource of type ‘API connection’ that is not leveraged by any workflow (logic app). API connections can be leveraged by multiple logic app workflows, both consumption and standard, so it’s quite tricky to identify the ones that can be safely deleted.

These types of abandoned connections happen when developers instead of reauthenticating their api connections use ‘Add Connection’ in their logic app to update the connection credentials. While seems like an obvious ‘don’t do it’ action, many still do that.

The way you can see there are orphanned connections in your app is by looking at API connection resource names. They will be suffixed by a number (something like on the screenshot below). In majority of cases that is already a nice indication of a growing problem.

Is there a no solve for it?

Technically the solve is simple, educate people to use ‘Authorize’ button on the API connection.

You can find it by navigating

  1. Find you API connection in your resource group and click on it
  2. Navigate to General section into EDIT API Connection tab
  3. Click on Authorize
  4. If you changed the account to entirely different one, feel free to update Display Name to reflect that

How to clean it up?

I suggest using a script by Sandro Pereira, a great Microsoft Azure MVP who already tackled this issue for you.

Ref: Find Orphaned Azure API Connectors in all Resource Groups with PowerShell


Image Source: https://blog.sandro-pereira.com

Once you try it, let me know your experience!

Summary

While logic apps are a great service, something a small thing like this might cause a management overhead. Be sure to put a proper governance rules, automations and monitoring in place to ensure adoption goes as you envisioned.

Adam Marczak

Programmer, architect, trainer, blogger, evangelist are just a few of my titles. What I really am, is a passionate technology enthusiast. I take great pleasure in learning new technologies and finding ways in which this can aid people every day. My latest passion is running an Azure 4 Everyone YouTube channel, where I show that Azure really is for everyone!

Did you enjoy the article?

Share it!

More tagged posts