简体   繁体   English

我的 Azure Function 在 Python v2 没有显示任何运行的迹象,但它可能是

[英]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 :我在检查tracesexceptions的应用程序洞察中看到以下警告:

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.

相关问题 在 azure 中运行 dash 应用程序功能 python model v2 但仅获取默认站点页面 - Running dash app in azure functions python model v2 but only getting default site up page Azure DevOps 管道 VsBuild 不适用于 Azure Function v2 - Azure DevOps Pipeline VsBuild dont work with Azure Function v2 Azure Function HttpClient 没有任何响应,不断重试 - Azure Function HttpClient doesn't give any response and keeps retrying v2 Azure Function 服务总线触发器未触发 - v2 Azure Function with Service Bus trigger not firing Azure 数据工厂V2:可选参数 - Azure Data Factory V2: Optional parameters v2 Function 无法加载类型“Microsoft.Azure.WebJobs.QueueTriggerAttribute” - v2 Function Could not load type 'Microsoft.Azure.WebJobs.QueueTriggerAttribute' python API 无法在 Dialogflow v2 中显示非英语列表意图 API - python API cant show non English language of list intents API in Dialogflow v2 Azure 存储(经典)与 Azure 存储(V2)代码不适用于 V2 存储 - Azure Storage (classic) vs Azure Storage (V2) code not working for V2 storage 上传 Intent 函数 Dialogflow V2 - Upload Intent function Dialogflow V2 Azure 数据工厂 V2 中的 LeaseAlreadyPresent 错误 - LeaseAlreadyPresent Error in Azure Data Factory V2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM