Chapter 4 · AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security
Azure Key Vault
20 practice questions · 5 marks weightage
Practice questions
- Question 1Q-5AB1F2See the answer and solution
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.
- 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.
- Question 2Q-E9725FSee the answer and solution
An application stores a database connection string in an Azure Key Vault secret named DbConnection. The operations team rotates the value by setting a new version of the same secret name. The application must begin using the new value without being redeployed. Which approach should the developer use?
- A.Call GetSecretAsync("DbConnection") without specifying a version, and refresh the cached value according to the application's rotation strategy.
- B.Use the original secret version ID permanently so that the application has a stable value.
- C.Delete the secret before every read so that Key Vault creates the newest version automatically.
- D.Read the secret only through an Azure Storage access key because Key Vault versions cannot be accessed by applications.
- Question 3Q-67025DSee the answer and solution
A company requires that deleted secrets in a production Key Vault remain recoverable for 90 days and cannot be permanently purged early, even by an administrator. Which configuration best satisfies this requirement?
- A.Enable soft delete with a 90-day retention period and enable purge protection on the Key Vault.
- B.Disable soft delete and grant all administrators the Key Vault Administrator role.
- C.Enable diagnostic logging only; logs automatically restore deleted secrets.
- D.Create a new secret version every 90 days and disable deletion permissions.
- Question 4Q-669D60See the answer and solution
An Azure App Service uses a system-assigned managed identity to read secret values from an Azure Key Vault. The identity must not create, update, or delete secrets. Which Azure RBAC role should be assigned at the Key Vault scope?
- A.Reader
- B.Key Vault Secrets User
- C.Key Vault Secrets Officer
- D.Contributor
- Question 5Q-FA30B2See the answer and solution
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 never be downloaded by the application. Which approach should the application use?
- A.Use SecretClient to retrieve the private key as a string and sign the data locally.
- B.Use CertificateClient to download the certificate and private key, then sign locally.
- C.Use KeyClient to obtain the key identifier, create a CryptographyClient, and call SignDataAsync with the appropriate RSA signature algorithm.
- D.Store the key in Azure Storage and use BlobClient to perform the signing operation.
15 more questions on Azure Key Vault
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed