VS Code开发Azure Function遇ParameterBindingData类型加载错误求助
Azure Function本地开发依赖加载错误问题处理
错误详情
遇到的错误提示:
Microsoft.Azure.WebJobs.Extensions.ServiceBus: Could not load type 'Microsoft.Azure.WebJobs.ParameterBindingData' from assembly 'Microsoft.Azure.WebJobs, Version=3.0.34.0, Culture=neutral, PublicKeyToken=****'. Value cannot be null. (Parameter 'provider')
该问题已在GitHub相关Issue中上报。
本地开发环境配置
host.json 配置
{ "version": "2.0", "logging": { "applicationInsights": { "samplingSettings": { "isEnabled": true, "excludedTypes": "Request" } } }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[3.15.0, 4.0.0)" } }
local.settings.json 配置
{ "IsEncrypted": false, "Values": { "FUNCTIONS_WORKER_RUNTIME": "python", "AzureWebJobsStorage": "UseDevelopmentStorage=true", "AzureWebJobsFeatureFlags": "EnableWorkerIndexing" } }
EventHub触发器代码
@app.function_name(name="EventHubTrigger1") @app.event_hub_message_trigger(arg_name="myhub", event_hub_name="samples-workitems", connection="") def test_function(myhub: func.EventHubEvent): logging.info('Python EventHub trigger processed an event: %s', myhub.get_body().decode('utf-8'))
问题与尝试
已知建议解决方案为降级Microsoft.Azure.WebJobs.Extensions.Storage包版本,但因不熟悉.NET,不清楚如何从扩展包中执行降级操作。已尝试修改host.json中extensionBundle的多个版本范围,均未解决错误。
补充解决方法
可尝试重装/更新Azure Function Core Tools,执行以下命令:
sudo apt-get update sudo apt-get install azure-functions-core-tools-4
内容的提问来源于stack exchange,提问作者DataBach
相关产品推荐
相关产品推荐

