Soru

Zorluk: KolayConfigure Azure App Service Web Apps

A developer is configuring an application setting in an Azure App Service web app to reference a secret stored in an Azure Key Vault named kv-prod. The secret is named db-conn-string. The web app has a system-assigned managed identity configured with appropriate permissions. Which syntax should the developer use as the value for the application setting to retrieve the latest version of the secret?

  1. @Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn-string)Cevap
  2. B
    @Microsoft.KeyVault(Vault=kv-prod;Secret=db-conn-string)
  3. C
    @KeyVault(VaultName=kv-prod;SecretName=db-conn-string)
  4. D
    VaultName=kv-prod;SecretName=db-conn-string

Cevap

The correct syntax to reference the Key Vault secret is @Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn-string)
The syntax @Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn-string) is correct because it uses the fully qualified namespace and the correct property keys (VaultName and SecretName) to dynamically fetch the latest version of the secret from Key Vault.

Adım Adım Çözüm

1
Identify the required components of an Azure Key Vault reference in App Service.
The reference must begin with the @Microsoft.KeyVault prefix followed by parentheses containing key-value pairs.
This signature informs the App Service runtime to resolve the value from Key Vault rather than treating it as a literal string.
2
Select the correct properties to reference the secret by name without specifying a version.
Use VaultName and SecretName properties.
Using VaultName and SecretName instructs App Service to fetch the latest version of the secret dynamically.
3
Verify property names and format correctness.
The correct format is VaultName=kv-prod;SecretName=db-conn-string separated by a semicolon.
Azure App Service expects exact key names (VaultName and SecretName) and will fail to resolve the secret if keys like Vault or Secret are used.

Anahtar Kavram

Key Vault References in App Service Application Settings
Bu soruyu puanla