Integrate Azure Event Hubs with Service Connector

This page shows the supported authentication types and client types of Azure Event Hubs using Service Connector. You might still be able to connect to Event Hubs in other programming languages without using Service Connector. This page also shows default environment variable names and values or Spring Boot configuration you get when you create service connections. You can learn more about the Service Connector environment variable naming convention.

Supported compute services

  • Azure App Service
  • Azure Container Apps
  • Azure Spring Apps

Supported authentication types and client types

Supported authentication and clients for App Service, Container Apps and Azure Spring Apps:

Client type System-assigned managed identity User-assigned managed identity Secret / connection string Service principal
.NET yes icon yes icon yes icon yes icon
Go yes icon yes icon yes icon yes icon
Java yes icon yes icon yes icon yes icon
Java - Spring Boot yes icon yes icon yes icon yes icon
Kafka - Spring Boot yes icon yes icon yes icon yes icon
Node.js yes icon yes icon yes icon yes icon
Python yes icon yes icon yes icon yes icon
None yes icon yes icon yes icon yes icon

Default environment variable names or application properties

Use the connection details below to connect compute services to Event Hubs. For each example below, replace the placeholder texts <Event-Hubs-namespace>, <access-key-name>, <access-key-value> <client-ID>, <client-secret>, and <tenant-id> with your Event Hubs namespace, shared access key name, shared access key value, client ID, client secret and tenant ID.

Azure App Service and Azure Container Apps

Secret / connection string

Default environment variable name Description Sample value
AZURE_EVENTHUB_CONNECTIONSTRING Event Hubs connection string Endpoint=sb://<Event-Hubs-namespace>.servicebus.windows.net/;SharedAccessKeyName=<access-key-name>;SharedAccessKey=<access-key-value>

System-assigned managed identity

Default environment variable name Description Sample value
AZURE_EVENTHUB_FULLYQUALIFIEDNAMESPACE Event Hubs namespace <Event-Hubs-namespace>.servicebus.windows.net

User-assigned managed identity

Default environment variable name Description Sample value
AZURE_EVENTHUB_FULLYQUALIFIEDNAMESPACE Event Hubs namespace <Event-Hubs-namespace>.servicebus.windows.net
AZURE_EVENTHUB_CLIENTID Your client ID <client-ID>

Service principal

Default environment variable name Description Sample value
AZURE_EVENTHUB_FULLYQUALIFIEDNAMESPACE Event Hubs namespace <Event-Hubs-namespace>.servicebus.windows.net
AZURE_EVENTHUB_CLIENTID Your client ID <client-ID>
AZURE_EVENTHUB_CLIENTSECRET Your client secret <client-secret>
AZURE_EVENTHUB_TENANTID Your tenant ID <tenant-id>

Azure Spring Cloud

Spring Boot secret/connection string

Default environment variable name Description Sample value
spring.cloud.azure.storage.connection-string Event Hubs connection string Endpoint=sb://servicelinkertesteventhub.servicebus.windows.net/;SharedAccessKeyName=<access-key-name>;SharedAccessKey=<access-key-value>

Spring Boot system-assigned managed identity

Default environment variable name Description Sample value
spring.cloud.azure.eventhub.namespace Event Hubs namespace <Event-Hub-namespace>.servicebus.windows.net

Spring Boot user-assigned managed identity

Default environment variable name Description Sample value
spring.cloud.azure.eventhub.namespace Event Hubs namespace <Event-Hub-namespace>.servicebus.windows.net
spring.cloud.azure.client-id Your client ID <client-ID>

Spring Boot service principal

Default environment variable name Description Sample value
spring.cloud.azure.eventhub.namespace Event Hubs namespace <Event-Hub-namespace>.servicebus.windows.net
spring.cloud.azure.client-id Your client ID <client-ID>
spring.cloud.azure.tenant-id Your client secret <client-secret>
spring.cloud.azure.client-secret Your tenant ID <tenant-id>

Next steps

Follow the tutorial listed below to learn more about Service Connector.