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
- 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
Assessment
This issue has not been assessed yet.