Azure App Service Web Apps · AZ-204: Developing Solutions for Microsoft Azure Develop Azure Compute Solutions
An ASP.NET Core web app hosted in Azure App Service must access a database password without storing the password in source code or in a deployment pa…
Practice question from Azure App Service Web Apps (AZ-204: Developing Solutions for Microsoft Azure Develop Azure Compute Solutions), with the correct answer and a step-by-step solution.
hard · MCQ · Q-D70B95
An ASP.NET Core web app hosted in Azure App Service must access a database password without storing the password in source code or in a deployment package. The password is stored as a secret in Azure Key Vault. The web app uses a system-assigned managed identity. Which configuration should you use?
- A.Add the plaintext password as an App Service application setting and disable managed identity.
- B.Add an application setting with a value such as @Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/DbPassword/) and grant the web app identity permission to read Key Vault secrets.Correct answer
- C.Add the Key Vault administrator username and password as application settings, then have the application call Key Vault.
- D.Place the secret in the web app's wwwroot directory and restrict access using an App Service access restriction.
Solution
App Service Key Vault references let an application setting resolve to a Key Vault secret without putting the secret value in source code or the deployment package. The web app's managed identity must be granted permission, such as the Key Vault Secrets User role when Azure RBAC is used.
More from Azure App Service Web Apps
- A web app has production and staging deployment slots. Each slot must use a different API endpoint, and the endpoint must remain associated…
- A team wants to release a new version of an Azure App Service web app with minimal production downtime. The team has a staging slot and a p…
- A company hosts an ASP.NET Core web app in Azure App Service. The company requires every request sent over HTTP to be redirected automatica…
- An Azure App Service web app must make outbound calls to a private REST API hosted inside an Azure virtual network. The web app must remain…
Practise more Develop Azure Compute Solutions
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