EventHubTrigger Connection using "Connection Strings" environment variable? (EVENTHUBCONNSTR_)
11:03 24 Dec 2025

I'm deploying a function app (v4, net10, Windows) to Azure; in the function I configure a EventHubTrigger.

[Function(nameof(MyEventHubProcessing))]
public async Task RunAsync([EventHubTrigger("MyEventHub", Connection = "MyEventHubConnectionString")] EventData[] events)
{

Then, I save the connection string under the "Connection Strings" tab of the environment variables of the Function App in Azure:

[! Connection String list.]1

In this configuration, at runtime, the Function App does not find the "Connection" value in the environment variables.

So, then I tried naming my connection using the special prefix EVENTHUBCONNSTR_:

[Function(nameof(MyEventHubProcessing))]
public async Task RunAsync([EventHubTrigger("MyEventHub", Connection = "EVENTHUBCONNSTR_MyEventHubConnectionString")] EventData[] events)
{

But apparently the abstraction that virtualizes the connection strings in environment variables is not in that code path?

So, then I tried using the full name in the App Settings, but Azure blocked me from using that prefix with a cryptic error (like I was a toddler, and mom was telling me not to do something, but not telling me why). [! Error screenshot.]2

Is this just a bug in the EventHubTrigger code that doesn't perform the proper indirection for connection strings?

(BTW, I understand I can use different approaches for authentication, that would be a workaround in this case, not a solution.)

azure-functions connection-string azure-eventhub appsettings