Azure Function not being triggered with EventHubTrigger - (extensionBundle version 2.x)

Maria 11 Reputation points
2021-03-31T14:59:37.783+00:00

Hello,
I am using Visual Studio code and Python environment.

After upgrading extensionBundle version from "[1.,2.0.0]" to "[2.,3.0.0]" the function stops being fired by the EventHubTrigger.
and this happens when debugging the function locally (after the deployment the newer version doesn't respond to incoming event either).

If I switch the extensionBundle back to [1.*,2.0.0] it starts to consume events again immediately...
Are there any packages that need to be installed?

The hosts.json example is below:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  },
  "extensions": {
    "eventHubs": {
      "batchCheckpointFrequency": 5,
      "eventProcessorOptions": {
          "maxBatchSize": 256,
          "prefetchCount": 512
      }
  }
}
}

function.json is below:

{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "connection": "AzureEventHubConnectionString",
      "name": "event",
      "type": "eventHubTrigger",
      "direction": "in",
      "consumerGroup": "$Default",
      "cardinality": "one",
      "eventHubName": "myEventHub"
    },
    {
      "type": "eventHub",
      "direction": "out",
      "name": "$return",
      "connection": "AzureOutEventHubConnectionString",
      "eventHubName": "myOutEventHub"
    }
  ]
}
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,262 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
556 questions
{count} vote

1 answer

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 22,776 Reputation points Microsoft Employee
    2021-04-02T21:44:18.88+00:00

    Hello @Maria , (posting this as an answer due to character limits for comments) Thank you for the additional information provided above and apologies for the delay. I could not reproduce the issue mentioned above, for me even after changing the Extension bundle version the function app consumed the events. If your function app is based on consumption plan this issue might be related to Cold Start.
    In order to determine the cause of the issue. Can you please try running the Function App after explicitly installing the extensions and see if you face the same error. As per the documentation the extension Bundle [1.*, 2.0.0) has the version 3.0.6 of Microsoft.Azure.WebJobs.Extensions.EventHubs and [2.*, 3.0.0) has 4.2.0. You can validate the extension installed in extensions.csproj file which is generated when you install extensions explicitly. You can check if you are able to consume the events locally and then on Azure for both the versions mentioned above.
    84126-image.png
    Please let me know if issue still persists. Thank you!

    1 person found this answer helpful.
    0 comments No comments