Access to cross-resource functions from within a function?

Copper Contributor

Step 1: Create a function (with alias 'productavailability') in an application insights instance.

            availabilityResults | where name == "blah"

Step 2: From a LA workspace, access the function using app('AppId').productavailability.  It works.
Step 3: Create a function in the LA workspace (with alias 'remoteproductavailability').  
Step 4: Execute the function.  Results in error:
            Unknown function: 'app'. Support id: ccc8637c-53cf-4364-b36b-e8b03bbe104b

 

Additional information - I can wrap a remote "table" (availabilityResults) in the function and it has no issue with the app().table syntax.

 

Any suggestions appreciated.

6 Replies

@Michael Faulkinbury 

 

Please can you share the function code (or an edit) from Step3?

@CliveWatson Thanks for your reply. Sure.

 

 

// definition saved with alias 'allproductmvp' 
union withsource= SourceApp
app('5c657003-fc6a-4a63-99f9-3608ab4bd293').productmvp,
app('23bdf41b-38c2-4292-b960-35a613c777f6').productmvp
// end definition

 

 
I can run the statement (function body) just fine, but when I try to run the function:

 

allproductmvp

 

 ...it results in the error posted.

@Michael Faulkinbury 

 

I doubt it's this but you can try an isfuzzy=true in case one/both the the workspaces isn't available - I'll try and take a deeper look tomorrow.  e.g. 

 

union isfuzzy=true withsource = SourceApp
workspace('Fabrikamltdprod').SecurityEvent,  
workspace('contosoretail-IT').SecurityEvent 
| parse SourceApp with * "('" applicationName "')" *  

 

@CliveWatson Thanks for looking into this, but I think my case is falling under a known issue.

 

A function in Azure Monitor cannot contain another function.

https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/functions

 

This seems like an important feature in order to avoid violations of the DRY principle.  Would you happen to know if this is on the product backlog or a related user voice item?

I will ask...thanks for the info, and sorry I wasn't able to look at this on Friday.

@Michael Faulkinbury 

 

Good news, this just back from the product group...

 

"This feature is work in progress and should be released in the next week or so"

 

I'll keep you updated if/when I hear more.  Thanks Clive