[英]My Azure Function in Python v2 doesn't show any signs of running, but it probably is
I have a simple function app in Python v2.我在 Python v2 中有一个简单的 function 应用程序。 The plan is to process millions of images, but right I just want to make the scaffolding right, ie no image processing, just dummy data.计划是处理数百万张图像,但我只是想让脚手架正确,即没有图像处理,只有虚拟数据。 So I have two functions:所以我有两个功能:
process
with an HTTP trigger @app.route
, this inserts 3 random image URLs to the Azure Queue Storage,使用 HTTP 触发器process
@app.route
,这会将 3 个随机图像 URL 插入到 Azure 队列存储中,process_image
with a Queue trigger @app.queue_trigger
, that processes one image URL from above (currently only logs the event). process_image
带有队列触发器@app.queue_trigger
,它从上面处理一张图像 URL (目前只记录事件)。 I trigger the first one with curl
request and as expected, I can see the invocation in the Azure portal in the function's invocation section and I can see the items in the Storage Explorer's queue.我用curl
请求触发了第一个请求,正如预期的那样,我可以在函数调用部分的 Azure 门户中看到调用,并且可以看到存储资源管理器队列中的项目。
But unexpectedly, I do not see any invocations for the second function, even though after a few seconds the items disappear from the images
queue and end up in the images-poison
queue.但出乎意料的是,我没有看到对第二个 function 的任何调用,即使几秒钟后项目从images
队列中消失并最终进入images-poison
队列。 So this means that something did run with the queue items 5 times.所以这意味着某些东西确实与队列项目一起运行了 5 次。 I see the following warning in the application insights checking traces
and exceptions
:我在检查traces
和exceptions
的应用程序洞察中看到以下警告:
Message has reached MaxDequeueCount of 5. Moving message to queue 'case-images-deduplication-poison'.
Can anyone help with what's going on?任何人都可以帮助解决发生的事情吗? Here's the gist of the code .这是代码的要点。
If I was to guess, something else is hitting that storage queue, like your dev machine or another function, can you put logging into the second function?如果我猜的话,其他东西正在进入存储队列,比如你的开发机器或另一个 function,你能把日志记录到第二个 function 吗? (sorry c# guy so I don't know the code for logging) (对不起 c# 的家伙,所以我不知道用于记录的代码)
Have you checked the individual function metric, in the portal, Function App >> Functions >> Function name >> overview >> Total execution Count and expand to the relevant time period?有没有查看个人function指标,在门户,Function App >> Functions >> Function name >> overview >> Total execution Count 展开到相关时间段?
Do note that it take up to 5 minutes for executions to show but after that you'll see them in the metrics请注意,执行最多需要 5 分钟才能显示,但之后您会在指标中看到它们
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.