首页 文章

Azure函数因StorageException而失败

提问于
浏览
1

我正在使用Azure功能,希望能够更深入地了解如何获取更详细的错误消息 .

函数从 queue 获取输入,这意味着将有多个并行运行的函数实例 . 该函数执行一些处理,并希望通过 ICollector<> 输出到 table storage

这些函数经常失败,但有异常

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.

我可以从日志中获取此异常,但我希望获得更多详细信息,例如: “Unexpected Response Code for Operation: 0” when executing Azure Table Storage batch delete .

问题是我无法在代码中捕获异常,因为绑定是在azure函数运行时完成的 .

有没有办法如何启用更详细的日志记录?

1 回答

  • 3

    你可以启用Application Insights吗?这将为您提供有关这些故障的更详细信息 .

    您可以找到有关如何为Function App here启用Application Insights的信息 .

    此外,查看存储帐户日志可能会提供有关可能导致故障的有用信息 .

    我也在创建此问题以跟踪增强功能:https://github.com/Azure/azure-webjobs-sdk/issues/1300

相关问题