A development team is configuring an Azure Function App (V4 runtime) to connect to a SQL database. The database connection string must be stored securely in Azure Key Vault. The security architecture mandates that the Function App must retrieve the connection string at runtime using a system-assigned managed identity, without storing any credentials in the application's configuration settings.
Which of the following configuration flows must be implemented to ensure the Function App can successfully retrieve the connection string?
- AEnable the system-assigned managed identity on the Function App, set the application setting value to @Microsoft.KeyVault(SecretUri=https://<vault-name>.vault.azure.net/secrets/<secret-name>/), and do not assign Key Vault roles as system-assigned identities automatically inherit read permissions within the same resource group.
- Enable the system-assigned managed identity on the Function App, grant this identity the Key Vault Secrets User role on the Key Vault, and set the application setting value to @Microsoft.KeyVault(SecretUri=https://<vault-name>.vault.azure.net/secrets/<secret-name>/).Cevap
- CEnable the system-assigned managed identity on the Function App, grant this identity the Key Vault Secrets User role on the Key Vault, and set the application setting value to @KeyVault(SecretUri=https://<vault-name>.vault.azure.net/secrets/<secret-name>/).
- DEnable a user-assigned managed identity on the Function App, grant this identity the Key Vault Secrets User role on the Key Vault, set the application setting value to @Microsoft.KeyVault(SecretUri=https://<vault-name>.vault.azure.net/secrets/<secret-name>/), and omit further configurations as App Service resolves user-assigned identities automatically.
Cevap
Enable the system-assigned managed identity on the Function App, grant this identity the Key Vault Secrets User role on the Key Vault, and set the application setting value to @Microsoft.KeyVault(SecretUri=https://<vault-name>.vault.azure.net/secrets/<secret-name>/).
To securely fetch secrets from Azure Key Vault without storing credentials, you must enable the system-assigned managed identity on the Function App and authorize it in the Key Vault by granting the Key Vault Secrets User role. Additionally, the Key Vault reference in the Application Settings must conform to the strict '@Microsoft.KeyVault(SecretUri=...)' syntax.
Adım Adım Çözüm
Anahtar Kavram
Configuring Key Vault references with Managed Identities in Azure Functions