Question

Difficulty: EasyAzure Key Vault Secret, Key, and Certificate Management

You are deploying an Azure App Service web application that must retrieve a database connection string from an Azure Key Vault without modifying the application code. You plan to configure an application setting in App Service to reference the Key Vault secret directly. The secret is located at the URI: https://contosovault.vault.azure.net/secrets/dbconn/f3b890. Which syntax format must you use for the App Service application setting value to reference this secret?

  1. @Microsoft.KeyVault(SecretUri=https://contosovault.vault.azure.net/secrets/dbconn/f3b890)Answer
  2. B
    @Azure.KeyVault(SecretUri=https://contosovault.vault.azure.net/secrets/dbconn/f3b890)
  3. C
    @Microsoft.KeyVault(SecretUrl=https://contosovault.vault.azure.net/secrets/dbconn/f3b890)
  4. D
    https://contosovault.vault.azure.net/secrets/dbconn/f3b890

Answer

The syntax prefixing the secret's URI with @Microsoft.KeyVault(SecretUri=...) is correct.
The correct answer is the syntax prefixing the URI with @Microsoft.KeyVault(SecretUri=...). When App Service detects this pattern, it resolves the secret from Key Vault on behalf of the application using the application's managed identity.

Step-by-Step Solution

1
Identify the requirement to resolve an Azure Key Vault secret inside an App Service configuration setting.
The App Service must use the Key Vault reference syntax to intercept the environment variable loading and fetch the secret value.
This allows the application to retrieve secrets dynamically without requiring custom Key Vault SDK integration.
2
Select the correct provider prefix and parameter for the reference.
The provider prefix must be '@Microsoft.KeyVault' and the parameter must be 'SecretUri'.
The App Service runtime specifically parses '@Microsoft.KeyVault' and expects 'SecretUri' as the parameter containing the full secret URL.

Key Concept

Azure Key Vault Reference Syntax in App Service
Rate this question