Question

Difficulty: Very hardCreate and Configure Azure Functions

You are designing a serverless solution that uses Azure Functions V4 to process messages from an Azure Service Bus queue. The architecture must comply with the following operational and security requirements:
1. The Service Bus namespace is configured with a private endpoint, and all public network access is disabled.
2. The Function App must scale dynamically (including scaling to zero instances) based on the volume of messages in the queue.
3. No connection strings or secrets can be stored in the Function App settings or in Azure Key Vault.
4. The Function App must authenticate to the Service Bus namespace using a user-assigned managed identity named func-identity.

Which combination of hosting plan and application settings should you configure for the Function App?

  1. A
    Hosting Plan: Consumption
    Application Settings:
    - WEBSITE_RUNTIME_SCALE_MONITORING_ENABLED = 1
    - ServiceBusConnection__fullyQualifiedNamespace = sb-namespace.servicebus.windows.net
    - ServiceBusConnection__credential = managedidentity
    - ServiceBusConnection__clientId = <client-id-of-func-identity>
  2. Hosting Plan: Premium (Elastic Premium)
    Application Settings:
    - WEBSITE_RUNTIME_SCALE_MONITORING_ENABLED = 1
    - ServiceBusConnection__fullyQualifiedNamespace = sb-namespace.servicebus.windows.net
    - ServiceBusConnection__credential = managedidentity
    - ServiceBusConnection__clientId = <client-id-of-func-identity>
    Answer
  3. C
    Hosting Plan: Premium (Elastic Premium)
    Application Settings:
    - WEBSITE_RUNTIME_SCALE_MONITORING_ENABLED = 1
    - ServiceBusConnection__fullyQualifiedNamespace = sb-namespace.servicebus.windows.net
    - ServiceBusConnection__credential = managedidentity
    - ServiceBusConnection__identityId = <resource-id-of-func-identity>
  4. D
    Hosting Plan: Premium (Elastic Premium)
    Application Settings:
    - WEBSITE_RUNTIME_SCALE_MONITORING_ENABLED = 1
    - ServiceBusConnection = @KeyVault(SecretUri=https://kv-name.vault.azure.net/secrets/sb-conn/)

Answer

Hosting Plan: Premium (Elastic Premium) with settings: WEBSITE_RUNTIME_SCALE_MONITORING_ENABLED = 1, ServiceBusConnection__fullyQualifiedNamespace = sb-namespace.servicebus.windows.net, ServiceBusConnection__credential = managedidentity, and ServiceBusConnection__clientId = <client-id-of-func-identity>
The correct configuration utilizes the Premium (Elastic Premium) hosting plan to enable outbound Virtual Network (VNet) integration, allowing access to the Service Bus namespace via its private endpoint. To scale dynamically, the runtime scale monitoring setting (WEBSITE_RUNTIME_SCALE_MONITORING_ENABLED) must be set to 1, enabling the Functions scale controller to probe the queue over the VNet. Furthermore, the identity-based connection for a user-assigned managed identity is correctly declared with properties specifying the fully qualified namespace, setting the credential type to 'managedidentity', and supplying the client ID of the identity.

Step-by-Step Solution

1
Select the Elastic Premium hosting plan.
The Elastic Premium plan supports outbound Virtual Network integration.
Required because the Service Bus namespace is behind a private endpoint and cannot be accessed via the public internet.
2
Enable runtime scale monitoring.
WEBSITE_RUNTIME_SCALE_MONITORING_ENABLED is set to 1 in application settings.
Required so the Azure Functions scale controller can access queue metrics to scale the app dynamically when resources are secured inside a VNet.
3
Configure the identity-based connection to Service Bus.
Define ServiceBusConnection__fullyQualifiedNamespace, ServiceBusConnection__credential, and ServiceBusConnection__clientId settings.
Enables the Function App to authenticate using the user-assigned managed identity without any connection strings or secrets.

Key Concept

Identity-based connections and virtual network trigger scaling configuration for Azure Functions.
Rate this question