AZ-204 Develop Azure compute solutions Practice Question
A report export service in Azure App Service must safely access Key Vault secrets without connection strings in configuration. Which two steps are required?
⚠ Common exam trap
Many exam-takers think storing the Key Vault URI or a reference in app settings is sufficient, but the question explicitly requires 'without connection strings in configuration,' so the correct path is to use managed identity plus granting permissions, not storing any key material.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Grant the identity permission to read the required secrets
Granting the managed identity permission to read secrets in Key Vault via Azure RBAC or access policies ensures that the App Service can authenticate without storing any secrets in configuration. This follows the principle of least privilege and eliminates the risk of credential leakage from app settings or connection strings.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable anonymous access on the vault
Why it's wrong here
Azure Key Vault is specifically designed to secure sensitive information like cryptographic keys, secrets, and certificates. Enabling anonymous access would fundamentally compromise its core security purpose, allowing any unauthenticated request to retrieve or manipulate these critical assets. Key Vault strictly enforces authentication and authorization for all operations, making anonymous access an invalid and highly insecure configuration that is not permitted.
- ✗
Store the Key Vault access key in app settings
Why it's wrong here
Azure Key Vault does not utilize "access keys" in the same manner as some other Azure services like Storage Accounts; instead, access is primarily granted to Azure Active Directory (Azure AD) identities. Storing any form of credential, such as a client secret or certificate, directly within app settings for Key Vault authentication defeats the primary security benefit of Key Vault, which is to centralize and protect credentials from application code and configuration files, making it a poor security practice.
- ✓
Grant the identity permission to read the required secrets
Why this is correct
After an identity (such as a managed identity) is established for the Azure App Service, it must be explicitly authorized to perform specific operations within Azure Key Vault. This authorization is achieved by assigning appropriate permissions, typically through Azure Role-Based Access Control (RBAC) roles like "Key Vault Secrets User" or by configuring an access policy directly on the Key Vault, granting "Get" and "List" secret permissions to the service principal. This ensures the principle of least privilege is followed.
- ✓
Enable a managed identity for the web app
Why this is correct
Enabling a managed identity for the Azure App Service provides it with an automatically managed identity in Azure Active Directory (Azure AD). This eliminates the need for developers to manually manage credentials, such as connection strings or client secrets, within the application code or configuration files. The App Service can then use this Azure AD identity to securely authenticate to other Azure services, like Key Vault, without storing any secrets itself, significantly enhancing security and simplifying credential management.
Quick reference
Access Control Model Comparison
| Model | Acronym | Who Controls Access? | Best For |
|---|---|---|---|
| Discretionary Access Control | DAC | Resource owner | Small teams, file shares |
| Mandatory Access Control | MAC | System / security labels | Classified govt / military |
| Role-Based Access Control | RBAC | Administrator (via roles) | Enterprise environments |
| Attribute-Based Access Control | ABAC | Policy engine (user + resource attributes) | Fine-grained, dynamic policies |
| Rule-Based Access Control | RuBAC | System rules / ACLs | Firewall rules, network ACLs |
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Key Vault Secrets
Key Vault Secrets are secure containers in Microsoft Azure that store sensitive information like passwords, connection strings, and API keys, keeping them encrypted and accessible only to authorized applications and users.
Key term
Managed identity
A managed identity is an automatically managed service principal in Azure that allows your code to authenticate to any service that supports Azure AD authentication without storing credentials.
About these practice questions
Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.