Question

Difficulty: MediumCreate and Configure Azure Functions

You are developing a V4 Azure Function App. A function within the app is triggered by messages from an Azure Queue Storage queue named incoming-orders. The function is configured with a connection property value of OrderStorageConnection.

You want to configure the Function App to use its system-assigned managed identity to connect to the queue in a storage account named orderstore instead of using a connection string.

Which application setting should you add to the Function App?

  1. OrderStorageConnection__queueServiceUri with the value https://orderstore.queue.core.windows.netAnswer
  2. B
    OrderStorageConnection with the value https://orderstore.queue.core.windows.net
  3. C
    OrderStorageConnection__serviceUri with the value https://orderstore.queue.core.windows.net
  4. D
    OrderStorageConnection__credential with the value SystemAssigned

Answer

OrderStorageConnection__queueServiceUri with the value https://orderstore.queue.core.windows.net
The correct option is the one specifying OrderStorageConnection__queueServiceUri with the service endpoint. For Azure Queue Storage triggers and bindings, identity-based connections require the application setting key to consist of the connection name prefix followed by the service-specific suffix '__queueServiceUri'. Since the system-assigned managed identity is used by default when no credential property is set, providing the endpoint URL is sufficient to establish the connection.

Step-by-Step Solution

1
Identify the logical connection name used in the trigger configuration.
The logical connection name is OrderStorageConnection.
The connection property of the trigger attribute points to this application setting prefix.
2
Determine the required suffix for an identity-based Azure Queue Storage trigger connection.
The required suffix is __queueServiceUri.
Azure Functions uses service-specific suffixes to identify the type of service endpoint for identity connections.
3
Combine the connection name, suffix, and endpoint to form the configuration key-value pair.
The configuration key is OrderStorageConnection__queueServiceUri and the value is the queue service endpoint: https://orderstore.queue.core.windows.net.
This structure directs the Azure Functions runtime to use the managed identity to connect to the specific Queue Storage endpoint.

Key Concept

Configuring Identity-Based Connections for Azure Functions Triggers and Bindings
Rate this question