运行func start启动Azure Function时报Value cannot be null错误
Azure Function执行func start启动报错解决方案
报错特征
执行func start启动本地Azure Function项目时,同时提示Core Tools版本过旧,且抛出Value cannot be null. Parameter name: provider错误,完整错误日志如下:
You are using an outdated version of the Azure Functions Core Tools. Found Python version 3.6.9 (python3). Azure Functions Core Tools Core Tools Version: 2.7.3188 Commit hash: f5984038c7377e9437f71191bff1d5818dd1fa8d Function Runtime Version: 2.0.14786.0 AZURE_FUNCTIONS_ENVIRONMENT: Development Value cannot be null. Parameter name: provider
修复步骤
- 升级Azure Functions Core Tools到4.x最新稳定版
- npm安装的版本执行命令:
npm install -g azure-functions-core-tools@4 --unsafe-perm true - 包管理器(apt/brew/choco等)安装的版本对应执行对应升级指令,目标为4.x大版本
- npm安装的版本执行命令:
- 修复运行时版本匹配问题
- 执行
func --version确认升级后的Core Tools版本为4.x - 升级本地Python版本到3.8~3.11区间的LTS版本,日志中的Python 3.6已不再被当前Function runtime支持
- 执行
- 清理本地项目缓存重试
- 删除项目目录下的旧虚拟环境目录
.venv,重新创建虚拟环境并安装项目依赖 - 存在
bin、obj缓存目录的项目一并删除上述目录 - 重新执行
func start启动项目验证修复效果
- 删除项目目录下的旧虚拟环境目录
内容的提问来源于stack exchange,提问作者rajvi
相关产品推荐
相关产品推荐

