2

I am playing with Azure function and would like to get some more insight in how to get more detailed error message.

Function gets input from queue, which means there will be number of instances of the function running in parallel. The function does some processing and want to output into table storage by using ICollector<>

The functions quite frequently fails with exception

    Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.LoadActivityDetail 
    ---> System.InvalidOperationException : Error while handling parameter outputTable after function returned: 
    ---> Microsoft.WindowsAzure.Storage.StorageException : Element 0 in the batch returned an unexpected response code.

I can get this exception from log but I would like to get some more details as mentioned e.g. “Unexpected Response Code for Operation: 0” when executing Azure Table Storage batch delete.

The problem is that I cannot catch the exception in code as the binding is done azure functions runtime.

Is there a way how to enable some more detailed logging?

mybrave
  • 1,662
  • 3
  • 20
  • 37
  • Usually Table Storage provides enough information for debug, you just need to look at additional fields in the exception, you don't need to 'enable' any additional logging. As far as I remember, there is Response property in the exception that contains more information. – cassandrad Aug 16 '17 at 16:21
  • That's true, the exception would have the details. But it is different in case if there is used table storage binding. The function code is not directly inserting into table storage, it just prepare data and Azure functions runtime will try to insert and fail. – mybrave Aug 17 '17 at 14:04

1 Answers1

3

Could you please enable Application Insights? This would give you more detailed information about those failures.

You can find information on how to enable Application Insights for your Function App here.

In addition, looking at your storage account logs may provide helpful information about what might be causing the failure.

I'm also creating this issue to track an enhancement: https://github.com/Azure/azure-webjobs-sdk/issues/1300

Fabio Cavalcante
  • 12,328
  • 3
  • 35
  • 43
  • thanks for suggestion - I will enable the App Insights and check once again – mybrave Aug 17 '17 at 11:53
  • Application Insights seems to display same information as is shown in logs at least for application errors. Thanks for raising the issue on github, it would be really useful to get more details. Btw. I have realized what the issue is but it could be found much faster if the log gives some more details. Issue in my case was that the size of the data exceeded allowed 64 KB for column in the table. – mybrave Aug 17 '17 at 13:50
  • 1
    Yes. Opened the issue to make sure things that simple are clear. If you had that message to begin with, this would have been a quick fix :). Glad to hear you found the root cause. Curious though, where did you find that information? Storage logs? – Fabio Cavalcante Aug 17 '17 at 16:30
  • I have not found the error message anywhere. Just I noticed some executions of Azure function (with shorter TS inserts) are working well, so I have investigated and read more about table storage limits. I have been aware of 1MB per record but then found the limit on column. So I tried to truncate and all got processed well. Same error is also discussed here - https://stackoverflow.com/questions/4194702/getting-exception-the-property-value-is-larger-than-allowed-by-the-table-serv – mybrave Aug 18 '17 at 12:43