Azure Application Insights Queries to share the same variable

3.2k views Asked by At

I have an AI dashboard with a number of queries displaying the last run results. Every query does something like that:

let lastRun = customMetrics
| where session_Id != ''
| top 1 by timestamp desc
| project session_Id;

customMetrics
| where session_Id in (lastRun)
...

As already mentioned, results of queries (last run) are pinned to the dashboard.

Question is: Is there a way to inject SessionId (which is now calculated every time as lastRun local variable) without customising/duplicating the query? If not, can I at least modify only one query producing the sessionId in one place and the other queries (in separate scope) to update?

E.g. on a dashboard I type the sessionId I'm interested at and the sessionId passed to queries as a parameter? And ideally, the whole dashboard is refreshed.

Can I do it without Power BI?

1

There are 1 answers

0
John Gardner On

No, there's no way to do that in azure dashboards at the current time. There are now top level dashboard filters that are in progress that make it closer to a reality thugh.

as a Workaround you can totally do something like what you want soon in the workbooks feature of application insights, as you can make parameters in the workbook (either manually like a textbox to enter a value) or by using analytics queries to create dropdowns of values to pick from.

those values then get passed along through the rest of the workbook, so many queries in the workbook can share the same values. workbooks supports query AI, Log analytics, and also supports metrics views. you can customize the charts, add text, etc.