I'm trying to pass a variable to the app() expression in application insights logs
Does not work with an error Query could not parse at 'app' on line [2,0]
Tried double quotes, escaping toscalar, tostring... Always the same result.
Thank you everybody
(I'm a part of Application Insights team)
It is not possible (at least today). This limitation comes from this context:
There is an engine which runs raw KQL queries against resources. The engine doesn't know anything about "app" keyword.
There is something like preprocessor which analyzes a query and determines against which resources actually to run a query (and removes "app" from a query). This preprocessor cannot run KQL queries (at least today) and as a result it is not possible to use KQL to come up with dynamic resource identifiers.