Find Orphans / unused Web API connection using Azure Resource Graph

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

Day by day the API connections will keep growing up

As clean up, I will show below how to use the Azure Resource Graph  to make query against the API and logic app to find all the unused API 

 

 

 

 

 

resources | where type =~ 'Microsoft.Web/connections' |project id |join kind= leftouter ( resources | where type == 'microsoft.logic/workflows' |extend propertiesJson=parse_json(properties) |extend ConJson=propertiesJson["parameters"]["$connections"]["value"] |mvexpand Conn=ConJson |where notnull(Conn) |extend connectionId=extract("\"connectionId\":\"(.*)\"",1,tostring(Conn)) |project connectionId ) on $left.id==$right.connectionId

 

 

 

 

 

Mohammed_Barqawi_0-1624176261155.png

 

the query above join 'microsoft.logic/workflows' with 'Microsoft.Web/connections' and find all the unused connections 

 

More information 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.