【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

相关文章
|
10月前
|
API C++
【Azure 环境】VS Code登录China Azure(Function)报错 An error occurred while signing in: invalid_request - AADSTS65002
An error occurred while signing in: invalid_request - AADSTS65002: Consent between first party application 'c27c220f-ce2f-4904-927d-333864217eeb' and first party resource '797f4846-ba00-4fd7-ba43-dac1f8f63013' must be configured via preauthorization - applications owned and operated by Microsoft mus
467 13
|
9月前
|
JSON 监控 数据格式
1688 item_search_app 关键字搜索商品接口深度分析及 Python 实现
1688开放平台item_search_app接口专为移动端优化,支持关键词搜索、多维度筛选与排序,可获取商品详情及供应商信息,适用于货源采集、价格监控与竞品分析,助力采购决策。
|
9月前
|
缓存 监控 Android开发
京东 item_get_app 接口深度分析及 Python 实现
京东item_get_app接口可获取商品原始详情数据,包含更丰富的字段和细节,适用于电商分析、价格追踪等场景。需通过认证获取权限,支持字段筛选和区域化数据查询。
|
10月前
|
缓存 数据挖掘 API
淘宝 item_get_app 接口深度分析及 Python 实现
淘宝item_get_app接口是淘宝开放平台提供的移动端商品详情数据获取接口,相较PC端更贴近APP展示效果,支持获取APP专属价格、促销活动及详情页结构,适用于电商导购、比价工具、数据分析等场景。接口采用appkey+appsecret+session认证机制,需申请相应权限。本文提供Python调用示例及使用注意事项,帮助开发者高效对接移动端商品数据。
|
9月前
|
数据安全/隐私保护
【Azure Function App】PowerShell Function 执行 Get-AzAccessToken 的返回值类型问题:System.String 与 System.Security.SecureString
将PowerShell Function部署到Azure Function App后,Get-AzAccessToken返回值类型在不同环境中有差异。正常为SecureString类型,但部分情况下为System.String类型,导致后续处理出错。解决方法是在profile.ps1中设置环境变量$env:AZUREPS_OUTPUT_PLAINTEXT_AZACCESSTOKEN=false,以禁用明文输出。
231 1
|
10月前
|
JSON 数据格式
【Azure 环境】当一个Azure Function资源创建很久了,是否可以获取到它的创建时间呢?
用户在尝试获取 Azure Function App 的创建时间时发现,资源 JSON 中缺少 `createdTime` 字段,仅能查看到 `lastModifiedTime`。同时,活动日志和 Azure Resource Graph 查询也未能提供创建时间信息。经解答,Azure 并未为所有资源类型记录创建时间,建议在部署时将创建时间作为标签记录。若创建时间在 90 天内,可通过部署日志间接获取。
277 7
|
9月前
|
缓存 供应链 开发者
1688 item_get_app 接口深度分析及 Python 实现
1688平台item_get_app接口专为移动端设计,提供商品原始详情数据,包含批发价格、起订量、供应商信息等B2B特有字段,适用于采购决策、供应链分析等场景。接口需通过appkey+access_token认证,并支持字段筛选,返回结构化数据,助力企业实现智能采购与供应商评估。
|
10月前
|
数据采集 数据可视化 API
驱动业务决策:基于Python的App用户行为分析与可视化方案
驱动业务决策:基于Python的App用户行为分析与可视化方案
|
8月前
|
缓存 移动开发 JavaScript
如何优化UniApp开发的App的启动速度?
如何优化UniApp开发的App的启动速度?
1357 139

热门文章

最新文章