question

Maria-2570 avatar image
0 Votes"
Maria-2570 asked ChaitanyaNaykodiMSFT-9638 answered

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

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-functionsazure-event-hubs
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @Maria-2570, thank you for reaching out. I am trying reproduce the issue on my end. Can you please provide the information below?
1. Python version used
2. Function Runtime Version.
Thank you!





0 Votes 0 ·
Maria-2570 avatar image Maria-2570 ChaitanyaNaykodiMSFT-9638 ·

Hello @ChaitanyaNaykodiMSFT-9638 ,
The Python version used is 3.8.5, the function runtime version is 3.0.15371.0

0 Votes 0 ·

1 Answer

ChaitanyaNaykodiMSFT-9638 avatar image
0 Votes"
ChaitanyaNaykodiMSFT-9638 answered

Hello @Maria-2570, (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!



image.png (67.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.