Microsoft Azure Functions:价值“提供者” VS Code 生成的 Python 函数应用程序不能为 null
这是我第 n 次遇到此错误,但这是我第一次使用 Azure 上的 Python 函数。以前,我在使用基于 Java 的函数以及 Azure 上的 Spring Cloud Function 时也遇到过同样的问题。
我使用官方 VS Code 扩展提供的所有默认值(在设置过程中配置适当的连接字符串)创建了一个基于 Python 的函数应用程序(使用 Blob 触发器)。尝试在本地运行我的函数应用程序时,出现以下错误(带有 --verbose 标志):
[2022-04-11T10:04:25.432Z] Host configuration file read:
[2022-04-11T10:04:25.432Z] {
[2022-04-11T10:04:25.432Z] "version": "2.0",
[2022-04-11T10:04:25.432Z] "logging": {
[2022-04-11T10:04:25.432Z] "applicationInsights": {
[2022-04-11T10:04:25.432Z] "samplingSettings": {
[2022-04-11T10:04:25.432Z] "isEnabled": true,
[2022-04-11T10:04:25.432Z] "excludedTypes": "Request"
[2022-04-11T10:04:25.432Z] }
[2022-04-11T10:04:25.432Z] }
[2022-04-11T10:04:25.432Z] },
[2022-04-11T10:04:25.432Z] "extensionBundle": {
[2022-04-11T10:04:25.432Z] "id": "Microsoft.Azure.Functions.ExtensionBundle",
[2022-04-11T10:04:25.432Z] "version": "[2.*, 3.0.0)"
[2022-04-11T10:04:25.432Z] }
[2022-04-11T10:04:25.432Z] }
[2022-04-11T10:04:25.456Z] Loading functions metadata
[2022-04-11T10:04:25.483Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:java
[2022-04-11T10:04:25.485Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:powershell
[2022-04-11T10:04:25.486Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:node
[2022-04-11T10:04:25.487Z] Reading functions metadata
[2022-04-11T10:04:25.503Z] 1 functions found
[2022-04-11T10:04:25.516Z] 1 functions loaded
[2022-04-11T10:04:25.522Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /Users/sbsatter/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2022-04-11T10:04:25.525Z] 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-04-11T10:04:26.131Z] Downloading extension bundle from https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/2.8.4/Microsoft.Azure.Functions.ExtensionBundle.2.8.4_any-any.zip to /var/folders/7b/8bk0vwqx1yb9fvfdlj0qnlwh0000gn/T/dd0cf939-8efb-423e-ba0f-abb0027874e6/Microsoft.Azure.Functions.ExtensionBundle.2.8.4.zip
Value cannot be null. (Parameter 'provider')
This is the nth time I am running into this error, but this time it's my first time with Python Functions on Azure. Previously I faced the same with Java based functions and also probably Spring Cloud Function on Azure.
I created a Python based Function application (with Blob Trigger) using all the defaults provided by the official VS Code extension (configuring appropriate connection string during setup). On attempting to run my functions app locally, it gives the following error (with --verbose flag):
[2022-04-11T10:04:25.432Z] Host configuration file read:
[2022-04-11T10:04:25.432Z] {
[2022-04-11T10:04:25.432Z] "version": "2.0",
[2022-04-11T10:04:25.432Z] "logging": {
[2022-04-11T10:04:25.432Z] "applicationInsights": {
[2022-04-11T10:04:25.432Z] "samplingSettings": {
[2022-04-11T10:04:25.432Z] "isEnabled": true,
[2022-04-11T10:04:25.432Z] "excludedTypes": "Request"
[2022-04-11T10:04:25.432Z] }
[2022-04-11T10:04:25.432Z] }
[2022-04-11T10:04:25.432Z] },
[2022-04-11T10:04:25.432Z] "extensionBundle": {
[2022-04-11T10:04:25.432Z] "id": "Microsoft.Azure.Functions.ExtensionBundle",
[2022-04-11T10:04:25.432Z] "version": "[2.*, 3.0.0)"
[2022-04-11T10:04:25.432Z] }
[2022-04-11T10:04:25.432Z] }
[2022-04-11T10:04:25.456Z] Loading functions metadata
[2022-04-11T10:04:25.483Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:java
[2022-04-11T10:04:25.485Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:powershell
[2022-04-11T10:04:25.486Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:node
[2022-04-11T10:04:25.487Z] Reading functions metadata
[2022-04-11T10:04:25.503Z] 1 functions found
[2022-04-11T10:04:25.516Z] 1 functions loaded
[2022-04-11T10:04:25.522Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /Users/sbsatter/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2022-04-11T10:04:25.525Z] 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-04-11T10:04:26.131Z] Downloading extension bundle from https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/2.8.4/Microsoft.Azure.Functions.ExtensionBundle.2.8.4_any-any.zip to /var/folders/7b/8bk0vwqx1yb9fvfdlj0qnlwh0000gn/T/dd0cf939-8efb-423e-ba0f-abb0027874e6/Microsoft.Azure.Functions.ExtensionBundle.2.8.4.zip
Value cannot be null. (Parameter 'provider')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答我自己关于我的解决方法的问题(我想说的不是实际的解决方案),因为每隔几个月我就会遇到这个错误。
在我看来,在下载扩展包时,它由于某种原因而失败(或者更确切地说是超时),而日志中没有明确指定。我已经重试了几天但没有成功。因此,我从以下几行手动下载 ExtensionBundle 的 url:
并解压缩 zip 和 将其放在以下日志中提到的目录:
之后,函数应用程序就可以正常启动,您可以从以下日志中观察到
:解决方法也应该适用于其他触发器。
Answering my own question on my workaround (not an actual solution I would say) since every few months I end up facing this error.
It appears to me that while downloading the extension bundle, it fails for some reason (or rather times out) which isn't clearly specified in the logs. I have retried for days but have had no success. Hence, I manually download the url for ExtensionBundle from these lines:
and uncompress the zip, and place it in the directory mentioned in the following log:
Afterwards, the function app just starts fine as you can observe from the following logs:
This workaround should work for other triggers as well.