新文件到达容器后,Azure函数停止工作吗? [英] Azure functions stops working after new file arrive in the container?

查看:77
本文介绍了新文件到达容器后,Azure函数停止工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我们有一个Blob容器,其中包含来自AppCenter导出的100 000个日志文件. Appcenter连续每分钟将0-12个文件导出到容器中.

我们创建了一个在此容器上触发并将数据发送到弹性搜索的函数.为了创建新索引,我们希望函数在部署时在所有日志文件上触发,因此在部署之前,我们删除blob存储的所有收据.
当我们部署该功能时,一切都将开始正常工作.但是总会在几分钟后分解为打印以下日志消息:

Hi!

We have a blob container with 100 000 log files from AppCenter export. Appcenter continuously exports to the container 0-12 files per minute. 

We have created a function that triggers on this container and send the data to elastic search. In order to create a new index we want the function to trigger on all log files when it is deployed so before deploying we delete all receipts of the blob storage. 

When we deploy the function everything starts out working great. But always after a few minutes it breaks down printing out the following logmessage: 

2018-09-19T11:58:20.016 [Error] Function completed (Failure, Id=7e4e7161-3d04-455c-a5ca-5da20d85ef50, Duration=37ms)
2018-09-19T11:58:20.079 [Info] Function started (Id=1b5ffaa3-85f7-452e-9a87-1b454e105869)
2018-09-19T11:58:20.095 [Info] Function started (Id=2f118014-b73d-4d53-b8bb-4ceeeafc4434)
2018-09-19T11:58:20.095 [Error] Function completed (Failure, Id=1b5ffaa3-85f7-452e-9a87-1b454e105869, Duration=12ms)
2018-09-19T11:58:20.110 [Error] Function completed (Failure, Id=2f118014-b73d-4d53-b8bb-4ceeeafc4434, Duration=13ms)

当我们查看scm的函数输出时,会得到以下消息: 

When we look at the function output from scm we get the following message: 

myBlob	The blob is not a block blob.	
name	Binding data does not contain expected value 'name'.

具有以下调试输出:

Exception while executing function: ArchiveTrigger
Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: ArchiveTrigger ---> System.AggregateException : One or more errors occurred. ---> Exception binding parameter 'myBlob' ---> The blob is not a block blob.
   at Microsoft.Azure.WebJobs.Host.Executors.DelayedException.Throw()
   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstance instance,ParameterHelper parameterHelper,TraceWriter traceWriter,CancellationTokenSource functionCancellationTokenSource)
   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)
   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)
---> (Inner Exception #0) System.InvalidOperationException : Exception binding parameter 'myBlob' ---> System.InvalidOperationException : The blob is not a block blob.
   at Microsoft.Azure.WebJobs.Host.Blobs.StorageBlobToCloudBlockBlobConverter.Convert(IStorageBlob input)
   at Microsoft.Azure.WebJobs.Host.Blobs.ConverterArgumentBindingProvider`1.ConverterArgumentBinding.BindAsync(IStorageBlob value,ValueBindingContext context)
   at async Microsoft.Azure.WebJobs.Host.Blobs.Triggers.BlobTriggerBinding.BindAsync(Object value,ValueBindingContext context)
   at async Microsoft.Azure.WebJobs.Host.Triggers.TriggeredFunctionBinding`1.BindCoreAsync[TTriggerValue](ValueBindingContext context,Object value,IDictionary`2 parameters) 
   End of inner exception<---

---> (Inner Exception #1) System.InvalidOperationException : Exception binding parameter 'name' ---> System.InvalidOperationException : Binding data does not contain expected value 'name'.
   at Microsoft.Azure.WebJobs.Host.Bindings.Data.ClassDataBinding`1.BindAsync(BindingContext context)
   at async Microsoft.Azure.WebJobs.Host.Triggers.TriggeredFunctionBinding`1.BindCoreAsync[TTriggerValue](ValueBindingContext context…

我的直觉告诉我,导出到处理所有触发器的容器中的新文件以某种方式扰乱/破坏了队列原因,发生这种情况后,所有触发器都在返回错误之后发生.

有什么想法/想法吗?

最好的问候,
马蒂亚斯(Mattias)

My gut feeling tells me that somehow the new files that get exported to the container that is handling all of the triggers somehow disrupts/corrupts the queue cause after this has happened all triggers following return errors. 

Any thoughts/ideas?

Best regards,
Mattias

推荐答案

嘿马蒂亚斯(patti)

Hey Mattias

绑定 数据 包含期望值

Binding data does not contain expected value 'name'.

基于上述情况,我同意您的罪魁祸首可能在触发执行的操作之内.

Based on the above, i agree with you that the culprit could be within the operations that trigger carries out.

以您正在使用的规模(即+ 100K斑点),建议使用

At the kind of scale that you're working with (i.e. +100K blobs), the recommendation is to use Event Grid trigger instead of the Blob trigger itself. Is this something you've explored in implementing your solution? Also, are you utilizing any well-known patterns? Could you elaborate on your existing implementation a bit more?


这篇关于新文件到达容器后,Azure函数停止工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆