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')
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:
[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
and uncompress the zip, and place it in the directory mentioned in the following log:
[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
Afterwards, the function app just starts fine as you can observe from the following logs:
[2022-04-11T10:16:44.797Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /Users/sbsatter/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2022-04-11T10:16:44.800Z] Found a matching extension bundle at /Users/sbsatter/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/2.8.4
[2022-04-11T10:16:44.802Z] 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:16:45.076Z] Skipping bundle download since it already exists at path /Users/sbsatter/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/2.8.4
This workaround should work for other triggers as well.