Dan Schnau dot com

Find your Application Insights node from the Instrumentation Key with Azure CLI

I had an instrumentation key but I didn't know what instance of application insights telemetry was getting pumped into.

After some fiddling I got a one-line command in Azure CLI to get an Application Insights instance from an instrumentation key.

az graph query -q "Resources | where properties.InstrumentationKey =~ '00000000-0000-0000-0000-000000000000'"

The command spits out a JSON blob of information about any instances that match the query.