Tag Archives: VS Code Javascript Function

[Azure Function] VS Code Javascript Function Cannot Debug Locally: Value cannot be null. (Parameter ‘provider’)

Problem description

Refer to the official documents and create a JavaScript function through CS code, which appears when traveling locally:

Value cannot be null. (Parameter ‘provider’)

 

problem analysis

Step 1: open the detailed log of function, enter the directory of function in vs code, and then start local debugging in terminal

Input:   func start --verbose

Step 2: analyze logs

In the detailed log, it is found that the error occurred in the step of 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.

 

Solution:

After problem analysis, the root cause of the problem is the failure to download the extension bundle. Therefore, you may need to manually try to download the extension bundle file several times.

Download link: https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/3.3.0/Microsoft.Azure.Functions.ExtensionBundle.3.3.0_any-any.zip

After downloading, unzip the file into the azure Function Core Tools Directory, and then run function to solve the problem of value cannot be null (parameter ‘provider’) problem

 

Extension bundle file directory

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

**Outcome:**