Soru

Zorluk: KolayConfigure Azure App Service Web Apps

You are deploying a web application to an Azure App Service web app. The application must retrieve a database connection string stored as a secret named `DbPassword` in an Azure Key Vault named `vault-prod`. You configure a system-assigned managed identity for the web app and grant it the necessary Key Vault access. You need to configure a new application setting in the web app that references this secret. Which of the following application setting values uses the correct syntax to reference the Key Vault secret by vault and secret name?

  1. A
    @Azure.KeyVault(VaultName=vault-prod;SecretName=DbPassword)
  2. @Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)Cevap
  3. C
    @Microsoft.KeyVault(SecretName=DbPassword)
  4. D
    @Microsoft.KeyVault(vault-prod/DbPassword)

Cevap

The application setting value must be set to `@Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)`.
The syntax `@Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)` is correct because it uses the standard `@Microsoft.KeyVault` prefix and specifies both required parameters: `VaultName` and `SecretName` separated by a semicolon.

Adım Adım Çözüm

1
Identify the Key Vault reference prefix.
The correct prefix to use in Azure App Service application settings is `@Microsoft.KeyVault`.
This prefix tells the App Service runtime to parse the value as a Key Vault reference rather than a plain string.
2
Determine the parameters required for key-value pair referencing.
When not using a full secret URI, the reference requires both `VaultName` and `SecretName` parameters.
App Service needs both the target vault name and the specific secret name to locate the secret.
3
Construct the full configuration string using proper syntax.
The parameters must be enclosed in parentheses, formatted as `VaultName=vault-prod;SecretName=DbPassword`.
The parameters must match the expected key-value format separated by a semicolon inside the parentheses.

Anahtar Kavram

Configuring Key Vault references in Azure App Service application settings.
Bu soruyu puanla