Java EventHubTrigger not working with extensionBundle 2.x and funcino app is with terraform script

asked 2020-10-01T13:07:05.18+00:00
Thakur, Satyendra 1 Reputation point

I have been using azure-function app with premium plan with vnet integration and event-hub is having firewall enabled. The function app's vnet is allowed access in event-hub's firewall. We use WEBSITE_RUN_FROM_PACKAGE setting to deploy the zip archive for function. The creation of resources is automated using terraform.

The function app works if we use following extension bundle version as "version": "[1., 2.0.0)" and I can see events getting consumed by the function. However when I upgrade the extensionBundle version to "version": "[2., 3.0.0)" , I don't see events getting consumed by function app.

Platform: Java
OS: Linux
Service: Function App
Plan: Premium(EP1)
Function Runtime: ~3

Following is the host.json:

{
    "version": "2.0",
    "logging": {
        "fileLoggingMode": "always",
        "logLevel": {
            "default": "Information",
            "Host.Results": "Error",
            "Function": "Trace",
            "Host.Aggregator": "Trace"
        }
    },
    "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[2.*, 3.0.0)"
    },
    "extensions": {
        "eventHubs": {
            "batchCheckpointFrequency": 1,
            "eventProcessorOptions": {
                "maxBatchSize": 256,
                "prefetchCount": 512
            }
        }
    }
}

Following is the Java app code:

@FunctionName("processEvent")
    public void eventHubProcessor(
            @EventHubTrigger(name = "event", eventHubName = "event-hub-topic", connection = "EventHubListnerConnectionString", dataType = "string") String message,
            final ExecutionContext context) {
        context.getLogger().info(message);
    }

Generated function binding:

{
  "scriptFile": "../event-consumer-0.0.1-SNAPSHOT.jar",
  "entryPoint": "com.exp.event.consumer.EventConsumer.eventHubProcessor",
  "bindings": [
    {
      "type": "eventHubTrigger",
      "direction": "in",
      "name": "event",
      "dataType": "string",
      "connection": "EventHubListnerConnectionString",
      "eventHubName": "claim-inbound",
      "cardinality": "ONE"
    }
  ]
}

Everything has been same except for the extensionBundle which I upgraded to 2.x

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,573 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
357 questions
{count} votes