Home > Enterprise >  How to determine Application Insights instance from connection string?
How to determine Application Insights instance from connection string?

Time:01-07

I have an Application Insights connection string, and want to find my way to the instance in Azure Portal so that I can view logs from my app running with that connection string. We have many instances of Application Insights across several Subscriptions, across a couple Accounts, which means I can't just click into each of them and check the connection string for a match.

The connection string looks like InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://southcentralus.in.applicationinsights.azure.com/

There's a URL, but that's generic for all instances in the region. Only thing that's unique is the InstrumentationKey.

I tried logging into the Portal and entering the InstrumentationKey into the search box, no hits on any Account.

Am I out of luck?

CodePudding user response:

You can do it via a Resource Graph Query, for example in Azure CLI

az graph query -q "Resources | where type =~ 'Microsoft.Insights/components' | where properties['ConnectionString'] == 'InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://southcentralus.in.applicationinsights.azure.com/' | project id, resourceGroup, name"
  • Related