How to write Azure Kusto queries across multiple Application Insights instances

When writing Kusto queries it is often useful to be able to write queries that span multiple Application Insight instances. This is especially true for micro-services where each service has it’s own Application Insight instance. I’ve tried several times in the past to write cross instance queries and failed to find a way even though Microsoft documentation indicated that it should be possible. Here’s how I did it.

In Azure Portal (portal.azure.com), go to Monitor | Logs

This drops you into a UI where you are creating a new query. You should see a link to ‘Select Scope’

When selecting the scope you can see all your Application Insight instances and this UI looks like it should support selecting multiple Application Insight instances but it doesn’t. You can only select one at a time.

What I’ve found easiest is to add one of your Application Insight instances (through Select Scope), then when you return to the query you can click the star to favorite the scope (as shown below).

Then you can return to the Select Scope UI and change the scope to another Application Insights instance and favorite it as well. Continue doing this until you’ve added all the Application Insights instances as favorites.

Now you can just double left-click on the favorites and it will add it to your query.

Really what it’s doing is just adding app(‘<AppInsightsInstanceName>’) to the query as this is how you reference the different instances. I find having them sitting there as favorites makes it much easier to reference them.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: