Forum Discussion
Vino55
Microsoft
Feb 20, 2019Getting error 'unknown function'
I looked into this doc to create function.
I created function something like this:
let BIA = (timeframe:string="90d")
{
AzureDiagnostics
| where Category == "AzureBackupReport" and Operat...
Feb 20, 2019
Hi,
I think the correct way is to have this query:
AzureDiagnostics | where Category == "AzureBackupReport" and OperationName == "BackupItemAssociation" | project BackupItemUniqueId_s , BackupItemSourceSize_s , TimeGenerated | where TimeGenerated >= ago(90d)
Save this query as function. For example you can name the function BIA.
After that in Logs blade you just execute BIA just like it is table.
BIA
Vino55
Microsoft
Feb 21, 2019
I have done exactly the same. But getting error - Body of the callable expression cannot be empty.
I tried both BIA and BIA().Please look at the attached image.
But when I click the saved function, then it displays the function code.
- Feb 21, 2019
Hi,
I am pretty sure that you are not doing the same steps. Here are some detailed steps.
You create the function like this:
Do not use let operator. When executed the query should produce results (in my case I do not have the data but in your case you should). and save it as it is.
After that you can execute the function. Notice that intellisense now even recognize it.
Once executed the same results will be produced. For me the same error is produced as I do not have that data.