Find what Logic App is using an On Prem Gateway

Some time ago I wrote a post called Find application registrations used by Logic Apps. This post is really similar. If you know how to access and use the Azure Resource Graph Explorer, just skip to the end to get the KQL.

Using On Prem gateways to access data behind a firewall is great. You get a firewall friendly way of accessing services and databases simply by using HTTPs. The downside is that you need to keep track of all those gateways and most importantly: where are they used? This is a great candidate for using the Azure Resource Graph Explorer.

Enter Azure Resource Graph Explorer

This is a tool that uses KQL to query Azure resources. List all the VMs, show a list of all IP-addresses used etc etc. It is very very useful. Particularly in this case, when looking for a gateway usage.

Access

First off you need access to the resources you want to query. That might go without saying but I thought I just point that out.

Finding it

Use the search box in Azure (at the top of the page) and type resource graph. The service will show up in the result.

Using it

There are a number of predefined queries, and there is also an explorer to the left, showing you all types of Azure resources grouped by type. You can click any of these and they will show up in the query window.

Using it for Logic Apps

Sadly, there is very little in the way of help for Logic Apps and connectors but the resource type is very easy to find. Just pull up resource of the type you want to the query to be about and look under properties. There is always a property called Resource ID. That contains the resource type.

Find the gateway usage

Enter this KQL to list all the connections that use the given gateway.

resources
| where properties.parameterValues.gateway.name == "Gateway name here"

Hopefully you can find the information you need in the result. Use the resource group name or look under properties by scrolling to the right and clicking See details.