【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题

简介: 【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题

问题描述

参考官方文档,通过CS Code创建JavaScription Function,在本地远行时候出现:

Value cannot be null. (Parameter 'provider')



问题分析

第一步:开启Function的详细日志,在VS Code中进入Funciton所在目录,然后再 Terminal 中启动本地调试

输入:   func start --verbose

第二步:分析日志

详细日志中,发现错误发生在 Downloading extension bundle 这一步:

[2022-01-06T07:47:24.404Z] Loading functions metadata
[2022-01-06T07:47:24.509Z] Reading functions metadata
[2022-01-06T07:47:24.518Z] 0 functions found
[2022-01-06T07:47:24.535Z] 0 functions loaded
[2022-01-06T07:47:24.540Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at C:\Users\Administrator\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle
[2022-01-06T07:47:24.544Z] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json
[2022-01-06T07:47:25.432Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at C:\Users\Administrator\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle
[2022-01-06T07:47:25.435Z] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json
[2022-01-06T07:47:27.250Z] Downloading extension bundle from https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/3.3.0/Microsoft.Azure.Functions.ExtensionBundle.3.3.0_any-any.zip to C:\Users\Administrator\AppData\Local\Temp\fc4f430a-f517-4cd9-9192-c6ce9368f679\Microsoft.Azure.Functions.ExtensionBundle.3.3.0.zip
Value cannot be null. (Parameter 'provider')
[2021-12-22T01:34:45.182Z] Stopping host...
[2021-12-22T01:34:45.187Z] Host shutdown completed.


问题解答


经过问题分析,问题根源是下载extension bundle失败了。 所以可能需要多次手动尝试下载 Extension Bundle文件。

下载链接: https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/3.3.0/Microsoft.Azure.Functions.ExtensionBundle.3.3.0_any-any.zip

下载完成后,把文件解压放入Azure Function Core Tools 目录下,再运行function就可以可以解决 Value cannot be null. (Parameter 'provider') 问题



Extension Bundle文件目录

C:\Users\Administrator\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\3.3.0


**最终目录是以下内容:**


参考资料

在 Azure 中使用 Visual Studio Code 创建 JavaScript 函数:https://docs.microsoft.com/zh-cn/azure/azure-functions/create-first-function-vs-code-node


相关文章
|
9月前
|
Web App开发 存储 数据处理
Chrome 下载大文件报错!用 Streamsaver.js 完美填坑
本文探讨了Chrome下载大文件报“网络错误”的原因及解决方案。由于Chrome对Blob数据有大小限制,导致大文件下载失败。通过将responseType改为ArrayBuffer可临时解决1-2G文件问题,但超3G仍会崩溃。最佳方案是使用Streamsaver.js实现流式下载,边接收边保存,避免内存溢出,完美支持超大文件下载。
4805 3
|
11月前
|
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
499 13
|
API C++
【Azure Developer】VS Code上登录China Azure遇见错误:CAA20002
在VS Code中安装Azure Resource插件后,修改云环境为中国区Azure时,可能会遇到错误代码CAA20002。解决办法是将Microsoft Account的Client ID Version从默认的v1修改为v2。具体操作为:打开VS Code设置页面“Setting”,输入“microsoft account”过滤配置,在Microsoft中找到Client ID Version并将其值更改为v2。完成后测试登录即可成功。相关参考资料可查阅GitHub上的VS Code Azure登录问题讨论。
433 6
|
C++ Windows
【Function App】本地通过VS Code调试Function时候遇见无法加载文件错误Microsoft.Extensions.Diagnostics.Abstractions
在使用 VS Code 调试 Azure Functions 时,执行 `func host start` 可能因版本冲突报错。错误信息显示 Rpc Initialization Service 启动失败,可能是由于缺少文件或组件导致。解决方法包括:1) 使用 npm 卸载并重新安装 Azure Functions Core Tools;2) 若问题未解决,重新下载安装包(如 func-cli-x64.msi)修复旧版本工具;3) 退出并重启 VS Code,重新加载项目即可恢复正常运行。参考资料链接提供了更多背景信息。
493 1
|
缓存 JavaScript 前端开发
mapbox没有token/token失效,地图闪烁后变空白,报错Error: A valid Mapbox access token is required to use Mapbox GL JS.
本博客介绍了mapbox如何去除token验证,暴力破解mapbox的token验证机制。一劳永逸解决mapbox地图闪现一下然后变成空白,报错Error: A valid Mapbox access token is required to use Mapbox GL JS.的方法,还介绍了类似问题的具体解决思路。 只有锻炼思维才能可持续地解决问题,只有思维才是真正值得学习和分享的核心要素。如果这篇博客能给您带来一点帮助,麻烦您点个赞支持一下,还可以收藏起来以备不时之需,有疑问和错误欢迎在评论区指出~
|
前端开发 数据处理 Android开发
Flutter前端开发中的调试技巧与工具使用方法,涵盖调试的重要性、基本技巧如打印日志与断点调试、常用调试工具如Android Studio/VS Code调试器和Flutter Inspector的介绍
本文深入探讨了Flutter前端开发中的调试技巧与工具使用方法,涵盖调试的重要性、基本技巧如打印日志与断点调试、常用调试工具如Android Studio/VS Code调试器和Flutter Inspector的介绍,以及具体操作步骤、常见问题解决、高级调试技巧、团队协作中的调试应用和未来发展趋势,旨在帮助开发者提高调试效率,提升应用质量。
749 8
|
Java Maven Android开发
【Azure Developer】VS Code打包Java maven Project 遇见 BUILD FAILURE
Unknown lifecycle phase "lean". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>
743 5
|
JavaScript 前端开发 开发工具
【Azure Developer】使用JavaScript通过SDK进行monitor-query的client认证报错问题
AADSTS90002: Tenant 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant.
207 1
|
开发框架 .NET C#
VSCode开发.net项目时调试无效
【9月更文挑战第22天】在使用 VSCode 开发 .NET 项目时遇到调试问题,可从项目配置、调试配置、调试器安装、运行环境、日志和错误信息等方面排查。确认项目类型及文件配置,检查 `launch.json` 文件及配置项,确保调试器扩展已安装并启用,验证 .NET 运行时版本和环境变量,查看 VSCode 输出窗口和项目日志文件,检查权限及代码错误。若问题仍未解决,可查阅官方文档或社区论坛。
1039 5