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?

  1. 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
  2. B.Store the Key Vault access key in appsettings.json and use it to authenticate with SecretClient.
  3. C.Use the App Service deployment password as the Azure Key Vault credential.
  4. 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

All of Azure Key Vault

Practise more Implement Azure Security

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed