【Azure Function App】本地运行的Function发布到Azure上无法运行的错误分析

简介: 【Azure Function App】本地运行的Function发布到Azure上无法运行的错误分析

问题描述

Azure Function部署后未执行,查看日志发现错误信息:

2023-12-19T11:12:27.145 [Verbose] Host configuration applied.

2023-12-19T11:12:27.237 [Info] Starting Host (HostId=funapp-xxx-dev, Version=1.0.20776.0, InstanceId=xxx-x-xx-x-xxx, ProcessId=7924, AppDomainId=2, Debug=True, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=~1)

2023-12-19T11:12:27.102 [Verbose] Debug file watch initialized.

2023-12-19T11:12:27.222 [Verbose] File event source initialized.

2023-12-19T11:12:28.233 [Verbose] Function metadata read.

2023-12-19T11:12:28.345 [Verbose] Binding providers loaded.

2023-12-19T11:12:29.052 [Verbose] Binding providers initialized.

2023-12-19T11:12:29.052 [Info] Loaded custom extension 'BotFrameworkConfiguration'

2023-12-19T11:12:29.064 [Info] Loaded custom extension 'SendGridConfiguration'

2023-12-19T11:12:29.082 [Info] Loaded custom extension 'EventGridExtensionConfig'

2023-12-19T11:12:29.335 [Warning] Failed to load type 'xxxxx.xxxxx.xxxxx-1' from 'C:\home\site\wwwroot\bin\xxxxx.xxxxx.dll'

2023-12-19T11:12:29.335 [Warning] Failed to load type 'xxxxx.xxxxx.xxxxx-1' from 'C:\home\site\wwwroot\bin\xxxxx.xxxxx.dll'

2023-12-19T11:12:29.345 [Verbose] Extension loading complete.

2023-12-19T11:12:31.127 [Info] registered EventGrid Endpoint = https://funapp-export-dev.chinacloudsites.cn/admin/extensions/EventGridExtensionConfig

2023-12-19T11:12:31.847 [Verbose] Metadata provider created.

2023-12-19T11:12:32.407 [Verbose] Function descriptors read.

2023-12-19T11:12:32.407 [Info] Generating 0 job function(s)

2023-12-19T11:12:32.845 [Verbose] Development settings applied

2023-12-19T11:12:32.845 [Warning] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).

2023-12-19T11:12:33.423 [Info] Host initialized (6699ms)

2023-12-19T11:12:33.486 [Info] Host started (6761ms)

2023-12-19T11:12:33.486 [Info] Job host started

2023-12-19T11:12:33.552 [Error] The following 2 functions are in error:

ExportJob: The function type name 'xxxxx.xxxxx.xxxxx-1' is invalid.

RemoveBlobJob: The function type name 'xxxxx.xxxxx.xxxxx-1' is invalid.

2023-12-19T11:12:33.708 [Info] Host lock lease acquired by instance ID 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.

 

问题解决

在日志中,发现Function Host的Version=1.0, 这是非常老的Function Runtime Version。 而本地使用的 3.0 版本,所以从这一点判断出是版本问题导致。

需要通过设置 FUNCTIONS_EXTENSION_VERSION 参数,来指定版本信息。

 

 

参考资料

How to target Azure Functions runtime versions: https://learn.microsoft.com/en-us/azure/azure-functions/set-runtime-version?tabs=portal#automatic-and-manual-version-updates

相关文章
|
19天前
|
C# Windows
【Azure App Service】在App Service for Windows上验证能占用的内存最大值
根据以上测验,当使用App Service内存没有达到预期的值,且应用异常日志出现OutOfMemory时,就需要检查Platform的设置是否位64bit。
40 11
|
20天前
|
JavaScript C++ 容器
【Azure Bot Service】部署NodeJS ChatBot代码到App Service中无法自动启动
2024-11-12T12:22:40.366223350Z Error: Cannot find module 'dotenv' 2024-11-12T12:40:12.538120729Z Error: Cannot find module 'restify' 2024-11-12T12:48:13.348529900Z Error: Cannot find module 'lodash'
38 11
|
14天前
|
缓存 容器 Perl
【Azure Container App】Container Apps 设置延迟删除 (terminationGracePeriodSeconds) 的解释
terminationGracePeriodSeconds : 这个参数的定义是从pod收到terminated signal到最终shutdown的最大时间,这段时间是给pod中的application 缓冲时间用来处理链接关闭,应用清理缓存的;并不是从idel 到 pod被shutdown之间的时间;且是最大时间,意味着如果application 已经gracefully shutdown,POD可能被提前terminated.
|
18天前
|
开发框架 监控 .NET
【Azure App Service】部署在App Service上的.NET应用内存消耗不能超过2GB的情况分析
x64 dotnet runtime is not installed on the app service by default. Since we had the app service running in x64, it was proxying the request to a 32 bit dotnet process which was throwing an OutOfMemoryException with requests >100MB. It worked on the IaaS servers because we had the x64 runtime install
|
16天前
|
Java 开发工具 Windows
【Azure App Service】在App Service中调用Stroage SDK上传文件时遇见 System.OutOfMemoryException
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
|
17天前
|
安全 Apache 开发工具
【Azure App Service】在App Service上关于OpenSSH的CVE2024-6387漏洞解答
CVE2024-6387 是远程访问漏洞,攻击者通过不安全的OpenSSh版本可以进行远程代码执行。CVE-2024-6387漏洞攻击仅应用于OpenSSH服务器,而App Service Runtime中并未使用OpenSSH,不会被远程方式攻击,所以OpenSSH并不会对应用造成安全风险。同时,如果App Service的系统为Windows,不会受远程漏洞影响!
|
11天前
|
中间件 Docker Python
【Azure Function】FTP上传了Python Function文件后,无法在门户页面加载函数的问题
通过FTP上传Python Function至Azure云后,出现函数列表无法加载的问题。经排查,发现是由于`requirements.txt`中的依赖包未被正确安装。解决方法为:在本地安装依赖包到`.python_packages/lib/site-packages`目录,再将该目录内容上传至云上的`wwwroot`目录,并重启应用。最终成功加载函数列表。
|
2月前
|
JavaScript
箭头函数与普通函数(function)的区别
箭头函数是ES6引入的新特性,与传统函数相比,它有更简洁的语法,且没有自己的this、arguments、super或new.target绑定,而是继承自外层作用域。箭头函数不适用于构造函数,不能使用new关键字调用。
|
2月前
|
数据可视化 开发者 索引
详解Wireshark LUA插件函数:function p_myproto.dissector(buffer, pinfo, tree)
在 Wireshark 中,LUA 插件通过 `function p_myproto.dissector(buffer, pinfo, tree)` 扩展协议解析能力,解析自定义应用层协议。参数 `buffer` 是 `PacketBuffer` 类型,表示原始数据包内容;`pinfo` 是 `ProtoInfo` 类型,包含数据包元信息(如 IP 地址、协议类型等);`tree` 是
74 1
|
2月前
|
JavaScript
箭头函数与普通函数(function)的区别
箭头函数是ES6引入的新语法,相比传统函数表达式更简洁,且没有自己的this、arguments、super或new.target绑定,而是继承自外层作用域。这使得箭头函数在处理回调和闭包时更加灵活方便。

热门文章

最新文章