Soru

Zorluk: OrtaCreate and Configure Azure Functions

You are configuring an Azure Function App (V4) to retrieve messages from an Azure Service Bus queue using an identity-based connection. The Function App is configured with a user-assigned managed identity that has been granted the Azure Service Bus Data Receiver role on the Service Bus namespace. The trigger connection in the function code is named ServiceBusConnection. To ensure the Function App can successfully authenticate and connect using the user-assigned managed identity, which group of application settings must you configure?

  1. ServiceBusConnection__fullyQualifiedNamespace set to the namespace URL, ServiceBusConnection__credential set to managedidentity, and ServiceBusConnection__clientId set to the client ID of the user-assigned managed identity.Cevap
  2. B
    ServiceBusConnection set to the namespace URL, and ServiceBusConnection__managedIdentity set to the resource ID of the user-assigned managed identity.
  3. C
    ServiceBusConnection set to reference the Service Bus connection string using the Key Vault reference syntax @Microsoft.KeyVault(SecretUri=...).
  4. D
    ServiceBusConnection__serviceUri set to the namespace URL, and ServiceBusConnection__authentication set to SystemAssigned in the host.json file.

Cevap

Configure ServiceBusConnection__fullyQualifiedNamespace with the namespace URL, ServiceBusConnection__credential with managedidentity, and ServiceBusConnection__clientId with the client ID of the user-assigned managed identity.
The correct answer specifies ServiceBusConnection__fullyQualifiedNamespace, ServiceBusConnection__credential set to managedidentity, and ServiceBusConnection__clientId set to the client ID of the user-assigned managed identity. This aligns with the Azure Functions programming model for configuring user-assigned managed identities for external service triggers.

Adım Adım Çözüm

1
Define the connection endpoint.
Create the ServiceBusConnection__fullyQualifiedNamespace application setting and set it to the FQDN of the Service Bus namespace (e.g., namespace.servicebus.windows.net).
Identity-based connections in Azure Functions require specifying the fully qualified namespace endpoint rather than a complete connection string.
2
Specify the credential type.
Create the ServiceBusConnection__credential application setting and set its value to managedidentity.
This tells the Azure SDK to authenticate using a managed identity instead of trying to look for a client secret or other authentication mechanisms.
3
Associate the specific user-assigned identity.
Create the ServiceBusConnection__clientId application setting and set its value to the client ID of the user-assigned managed identity.
Since a user-assigned managed identity is used, the Function App needs the client ID of that identity to distinguish it from other identities or a system-assigned identity.

Anahtar Kavram

Azure Functions identity-based connections allow secure resource access without secrets by configuring FQDN and managed identity properties in the application settings.
Bu soruyu puanla