Azure / Azure/azure-functions-host

Consumption Plan - Azure Event Hub Trigger: JobHost stops after inactivity and does not wake back up when new messages arrive

Open
#8,241 10 comments 0 reactions 2 assignees Claimed by @v-bbalaiagar View on GitHub
Needs: Triage (Functions)
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

This is pretty much a duplicate of https://github.com/Azure/azure-functions-host/issues/7762

We are using the same setup but with managed identity and event hubs, it works fine after deployment or once reactivated through browsing the portal but after a while when it shuts down due to inactivity it will not restart as it should.

Looking through the logs we can see the following:
```
FunctionName: 'EventFunction'. An error occurred while setting up blob references. Exception: 'System.ArgumentException: ServiceBus Namespace not found.
at Microsoft.Azure.AppService.ScaleController.Extension.ActivationTasks.EventHubActivationTask.GetServiceBusNamespace(SiteMetadata siteInfo, String connectionName, Guid activationTaskId)
at Microsoft.Azure.AppService.ScaleController.Extension.ActivationTasks.EventHubActivationTask.TryCreate(ScaleControllerConfiguration config, SiteMetadata siteInfo, TriggerConfiguration trigger, Guid activationTaskId, ActivationTask& eventHubActivationTask, List`1& activationErrors)'.
```

We can also see the following even though it clearly does work for a while:

`Function app does not contain any active triggers.`
and
`Specified connection string is null or empty for connection: EventFunctionInputEventHubConnection. Invalid connection.`

These settings are set in the Configuration using:
```
EventFunctionInputEventHubConnection__credential: managedIdentity
EventFunctionInputEventHubConnection__fullyQualifiedNamespace: .servicebus.windows.net
EventFunctionInputEventHubName: eventhubname
```

The trigger we are using is:
`Microsoft.Azure.Functions.Worker.EventHubTriggerAttribute("%EventFunctionInputEventHubName%", Connection = "EventFunctionInputEventHubConnection")`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.