You are deploying an ASP.NET Core web application to an Azure App Service Web App named app-prod-01. The application requires a secret named DbConnectionString stored in an Azure Key Vault named kv-prod-01. The Web App has a system-assigned managed identity that is already configured with a GET access policy on the key vault. You must configure the application settings in the Web App to reference the Key Vault secret without modifying the code. Which configuration format must you use for the value of the DbConnectionString application setting?
- A@Microsoft.KeyVault(VaultUri=https://kv-prod-01.vault.azure.net/secrets/DbConnectionString)
- @Microsoft.KeyVault(VaultName=kv-prod-01;SecretName=DbConnectionString)Cevap
- C@Azure.KeyVault(SecretUri=https://kv-prod-01.vault.azure.net/secrets/DbConnectionString)
- D@Microsoft.KeyVault(VaultName=kv-prod-01,SecretName=DbConnectionString)
Cevap
The correct format is to use the key-value pair syntax with the @Microsoft.KeyVault prefix, specifying the VaultName and SecretName parameters separated by a semicolon.
The configuration syntax stating '@Microsoft.KeyVault(VaultName=kv-prod-01;SecretName=DbConnectionString)' is correct. App Service successfully parses this format, identifies the Key Vault resource by name, and fetches the secret using the web app's managed identity.
Adım Adım Çözüm
Anahtar Kavram
Azure App Service Key Vault references allow applications to securely access secrets from a key vault through environment variables without code modifications.
Tahmini Süre:1m 30s