2
votes

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?

1
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
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

1 Answers

3
votes

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