【Azure Function】Azure Function中的Timer Trigger无法自动触发问题

简介: 【Azure Function】Azure Function中的Timer Trigger无法自动触发问题

问题描述

在Azure Function中,部署了定时触发器函数(Timer Trigger),却无法按时触发。

 

问题解答

登录Function的Kudu站点,查看 logfiles中 application/function/host目录下的日志文件,发现错误消息:

Singleton lock renewal failed for blob 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/host' with error code 409: LeaseIdMismatchWithLeaseOperation. The last successful renewal completed at 2024-05-05T00:07:29.916Z (18845 milliseconds ago) with a duration of 48 milliseconds. The lease period was 15000 milliseconds.

这表示当前Function App不能从所绑定的Storage Account获取Lease,无法为Timer Trigger提供触发所需的Host ID / Lease ID信息。多个function app不建议用同一个storage account,因为function app都会在storage account中保存一个 host id,这个host id根据function app的名称来算的,如果function app 的名称长度大于32,就截取前32位。如果是一样的值,就会用同一个host id。导致出现争抢 Singleton Lock情况。

因为当前多个Function的确存在共用一个Stroage Account,并且名称长度超过32为,并且前32位的字符和其它Function App一样,所以引起了以上问题。在不能修改Function App的名字的情况下,通过修改位不同的Storage Account来解决了当前问题。

 

参考资料

AZFD0004:主机 ID 冲突:https://learn.microsoft.com/zh-cn/azure/azure-functions/errors-diagnostics/diagnostic-events/azfd0004#event-description

Host ID: https://learn.microsoft.com/zh-cn/azure/azure-functions/storage-considerations?tabs=azure-cli#host-id-considerations

相关文章
|
23天前
|
Java 容器
【Azure Function App】Java Function在运行中遇见内存不足的错误
【Azure Function App】Java Function在运行中遇见内存不足的错误
|
23天前
【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.
【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.
|
23天前
【Azure Function App】本地运行的Function发布到Azure上无法运行的错误分析
【Azure Function App】本地运行的Function发布到Azure上无法运行的错误分析
|
23天前
【Azure Function App】遇见无法加载Microsoft.Azure.WebJobs.ParameterBindingData的问题
【Azure Function App】遇见无法加载Microsoft.Azure.WebJobs.ParameterBindingData的问题
|
23天前
【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode mode enabled Traces。它是什么意思呢?
【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode mode enabled Traces。它是什么意思呢?
|
23天前
【Azure Function】在Function执行中遇见Timeout错误
【Azure Function】在Function执行中遇见Timeout错误
|
23天前
|
缓存
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
|
23天前
|
API
【Azure Function】Function本地调试时遇见跨域问题(blocked by CORS policy)
【Azure Function】Function本地调试时遇见跨域问题(blocked by CORS policy)
【Azure Function】Function本地调试时遇见跨域问题(blocked by CORS policy)
|
23天前
|
Python
【Azure Function】发布 Python Function 到 Azure 成功,但是无法显示Function列表
【Azure Function】发布 Python Function 到 Azure 成功,但是无法显示Function列表
|
23天前
|
C#
【Azure Function】Function App启动时出现 Failed to open local port 4001 错误,这是什么情况呢?
【Azure Function】Function App启动时出现 Failed to open local port 4001 错误,这是什么情况呢?

热门文章

最新文章