Azure Key Vault · AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security
An ASP.NET Core application runs in Azure App Service and must read a database password from Azure Key Vault without storing credentials in configura…
Practice question from Azure Key Vault (AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security), with the correct answer and a step-by-step solution.
easy · MCQ · Q-5AB1F2
An ASP.NET Core application runs in Azure App Service and must read a database password from Azure Key Vault without storing credentials in configuration or source code. Which implementation is most appropriate?
- A.Enable a system-assigned managed identity for the App Service, grant it the Key Vault Secrets User role, and use DefaultAzureCredential with SecretClient.Correct answer
- B.Store the Key Vault access key in appsettings.json and use it to authenticate with SecretClient.
- C.Use the App Service deployment password as the Azure Key Vault credential.
- D.Make the Key Vault publicly writable and retrieve the secret anonymously.
Solution
A system-assigned managed identity provides an Azure-managed identity without storing credentials in the application. The Key Vault Secrets User role grants data-plane permission to read secrets, and DefaultAzureCredential can use that identity when the application runs in App Service.
More from Azure Key Vault
- An application stores a database connection string in an Azure Key Vault secret named DbConnection. The operations team rotates the value b…
- A company requires that deleted secrets in a production Key Vault remain recoverable for 90 days and cannot be permanently purged early, ev…
- An Azure App Service uses a system-assigned managed identity to read secret values from an Azure Key Vault. The identity must not create, u…
- A .NET application must digitally sign data with an RSA key stored in Azure Key Vault. The private key must remain non-exportable and must…
Practise more Implement Azure Security
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed