Azure Functions V4 版本部署后遇到如下错误:

该错误可能出现在Python Function中。

Microsoft.Azure.WebJobs.Script: One or more loaded extensions do not meet the minimum requirements. For more information see https://aka.ms/func-min-extension-versions.
ExtensionStartupType EventHubsWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.EventHubs, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.3.0.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.EventHubs to 4.3.0 or later.

 

经调查,为V4 Function对扩展包的最低版本有要求,比如上述的错误提示为的 Host.json中,提示Microsoft.Azure.WebJobs.EventHubs, Version=4.2.0.0版本过低,至少需要Microsoft.Azure.WebJobs.EventHubs, Version=4.3.0.0.

经查文档:注册 Azure Functions 绑定扩展 | Microsoft Docs

主要原因是 代码中的 extensionBoundle 使用的是 "version": "[2.*, 3.0.0)",按照文档里的说明使用的 EventHubs 4.2.0.0

 

 

解决方案,将 extensionBundle中的version修改为:[3.3.0, 4.0.0)

如下图: 3.X的绑定的extensions里的event hub 扩展是5.0的版本,满足大于4.2.0.0的要求。