2

I am currently developing an Azure Function in VS Code. I am encountering an error that has already been reported in this GitHub issue. In full, the error reads: Microsoft.Azure.WebJobs.Extensions.ServiceBus: Could not load type 'Microsoft.Azure.WebJobs.ParameterBindingData' from assembly 'Microsoft.Azure.WebJobs, Version=3.0.34.0, Culture=neutral, PublicKeyToken=****'. Value cannot be null. (Parameter 'provider')

One of the suggested solutions is to downgrade the package version of the Microsoft.Azure.WebJobs.Extensions.Storage. However, I do not know how to downgrade a package from an extension bundle. In my local development environment, I'm using the following default host.json configuration:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[3.15.0, 4.0.0)"
  }
}

I already tried multiple version ranges, each lead to the same error. Since I'm not familiar with .NET, I would appreciate any help or advice on how to downgrade the package to resolve this issue. Thank you.

Additional information: I am developing an EventHub Triggered Function locally using the test trigger:

@app.function_name(name="EventHubTrigger1")
@app.event_hub_message_trigger(arg_name="myhub", event_hub_name="samples-workitems",
                               connection="") 

def test_function(myhub: func.EventHubEvent):
    logging.info('Python EventHub trigger processed an event: %s',
                myhub.get_body().decode('utf-8'))

The local.settings.json is as follows:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
  }
}

Update: Another way to solve this issue was to reinstall/ update the azure function core tools using these commands:

sudo apt-get update
sudo apt-get install azure-functions-core-tools-4
DataBach
  • 1,330
  • 2
  • 16
  • 31

4 Answers4

4

This problem was resolved by updating the version range to:

"version": "[3.3.0, 3.9.0)"

hesolar
  • 543
  • 4
  • 23
snicke
  • 45
  • 4
4

I have the same error in Microsoft.Azure.Functions.ExtensionBundle version 3.21.0. Solution: Modify the version in host.json to "version": "[3.*, 3.9.0)".

2

Refer my answer in this Post to resolve the similar error code.

Refer the answer by Jon koeter and this answer by Victoria Berra

Make sure you delete these 2 folders from your Local machine that might be conflicting when you run the Azure Function locally:-

enter image description here

After deleting these 2 folders, Make sure you delete Azure Function Core tools, you can get the path to your Azure Function Core tools from Environment variable from below settings in your local machine:-

enter image description here

Visit > C:\Program Files\Microsoft\Azure Functions Core Tools\ and then delete the Azure Functions Core Tools folder.

enter image description here

Now, Install Azure Function core tools from this MS Document again and then create and run the Azure Function event grid trigger.

I installed Azure Function Core tools again by following the link above and Created one Azure Event grid trigger locally the Trigger ran successfully like below:-

enter image description here

SiddheshDesai
  • 3,668
  • 1
  • 2
  • 11
  • In the end deleting the bundle worked with the caveat that on WSL with network restrictions we have to download and unzip the bundle from [here](https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/2.13.0/Microsoft.Azure.Functions.ExtensionBundle.2.13.0.zip) as answer provided [here](https://stackoverflow.com/questions/72704047/how-to-use-self-hosted-extensionbundle). @SiddheshDesai, for some reasons your images are not rendering. You should fix it to make it easier to understand for future readers. – DataBach May 16 '23 at 11:41
0

If you have the issue on MAC, I could make it run with following host.json file

 "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[3.3.0, 4.0.0)"
  },

And additionally needed to reinstall azure-functions-core-tools

brew uninstall azure/functions/azure-functions-core-tools
brew uninstall azure/functions/azure-functions-core-tools@4
brew install azure/functions/azure-functions-core-tools@4
Hannes Roth
  • 163
  • 1
  • 1
  • 7