An enterprise architecture requires that an Azure Function App (V4 runtime, .NET 8 isolated worker model) connects to an Azure Event Hubs namespace named 'fin-data-eh' without using any secrets or connection strings. The Function App uses a user-assigned managed identity to access the Event Hubs namespace, and the identity has been granted the Azure Event Hubs Data Receiver role. In the function code, the trigger attribute uses a connection property named `EventHubConnection`. Which configuration settings must be added to the application settings of the Function App to authenticate the trigger using the user-assigned managed identity?
- AConfigure only `EventHubConnection__fullyQualifiedNamespace` with the value `fin-data-eh.servicebus.windows.net` and leave other identity connection properties unset.
- BConfigure `EventHubConnection` with a Key Vault reference syntax `@Microsoft.KeyVault(SecretUri=https://fin-vault.vault.azure.net/secrets/EventHubConnectionString)` and assign the user-assigned managed identity to the Function App.
- Configure `EventHubConnection__fullyQualifiedNamespace` with the value `fin-data-eh.servicebus.windows.net`, `EventHubConnection__credential` with the value `managedidentity`, and `EventHubConnection__clientId` with the Client ID of the user-assigned managed identity.Answer
- DMigrate the Function App to a Dedicated (App Service) hosting plan, then configure `EventHubConnection__fullyQualifiedNamespace` with the value `fin-data-eh.servicebus.windows.net` and `EventHubConnection__identity` with the user-assigned managed identity's Resource ID.
Answer
Configure EventHubConnection__fullyQualifiedNamespace with the value fin-data-eh.servicebus.windows.net, EventHubConnection__credential with the value managedidentity, and EventHubConnection__clientId with the Client ID of the user-assigned managed identity.
To configure a user-assigned managed identity for an identity-based connection in Azure Functions V4, you must specify the fully qualified namespace of the target service, set the credential type to 'managedidentity', and specify the Client ID of the user-assigned identity using the designated double-underscore environment variable syntax.
Step-by-Step Solution
Key Concept
Azure Functions identity-based connections and user-assigned managed identity configuration