Forum Discussion
Michael Faulkinbury
Sep 11, 2019Copper Contributor
Access to cross-resource functions from within a function?
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 fun...
Michael Faulkinbury
Sep 12, 2019Copper Contributor
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.
CliveWatson
Microsoft
Sep 12, 2019
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 "')" *
- Michael FaulkinburySep 14, 2019Copper Contributor
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?
- CliveWatsonSep 16, 2019
Microsoft
I will ask...thanks for the info, and sorry I wasn't able to look at this on Friday.- CliveWatsonSep 16, 2019
Microsoft
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