Try a sample question
This is an original sample question written by itmoshi based on the exam objectives.
A web app running on Azure App Service must read a database connection string (a secret) stored in Azure Key Vault. The key vault uses the Azure RBAC permission model. Requirements: (1) no credentials may be stored in the app's settings or code; (2) following least privilege, nothing other than reading secrets may be allowed. How should you configure access?
- AEnable a system-assigned managed identity on the app and assign it Key Vault Secrets User scoped to the connection-string secret
- BCreate a service principal and store its client secret in the App Service application settings
- CEnable a system-assigned managed identity on the app and assign it the Key Vault Administrator role on the vault
- DIssue a shared access signature (SAS) token for the key vault and write it to the app's config file
Show answer and explanation
Answer:A To read the secret with least privilege and no stored credentials, assign Key Vault Secrets User to a managed identity, scoped to that secret.
Why it is correct
Azure manages the credentials of a managed identity automatically, so no secret has to live in the app settings or code. Key Vault Secrets User allows reading secret values and metadata; it grants no write permissions and no direct operations on keys or certificates. Scoping it to the connection-string secret also keeps the app from reading other secrets in the same vault, so both requirements are met.
The other options
- ✗ B The client secret ends up in the app settings, which violates the no-stored-credentials requirement and adds rotation work. Consider it only when neither a managed identity nor workload identity federation is available.
- ✗ C Key Vault Administrator allows every data operation, including creating and deleting secrets, keys and certificates, which violates least privilege. It is for people who manage the vault's contents.
- ✗ D Key Vault has no mechanism for reading secrets with a SAS token. SAS tokens grant time-limited access to services such as Azure Storage.
Key takeaway
Apps in Azure → managed identity, no stored credentials. Workloads outside Azure → prefer workload identity federation (or a managed identity on Azure Arc-enabled servers) over stored secrets. Keep both role and scope minimal (read secrets → Secrets User; manage → Secrets Officer/Administrator).
Try 20 questions like this for free
itmoshi is an unofficial study service and is not affiliated with Microsoft or any exam provider.