Assign the Right RBAC Role for Managed Identity to Read Key Vault Secrets
You deploy an Azure App Service web app that uses a system-assigned managed identity. The app needs to read a secret stored in Azure Key Vault to connect to a third-party service. You want to grant the minimum required permissions to the managed identity. Which Azure RBAC role should you assign to the managed identity at the Key Vault scope?
Quick Answer
The answer is the Key Vault Secrets User RBAC role. This role is correct because it grants the minimum required permission—specifically the Microsoft.KeyVault/vaults/secrets/getSecret/action—allowing a managed identity to read a secret from Azure Key Vault without any write or management capabilities, perfectly adhering to the principle of least privilege for an app that only needs to retrieve a secret for third-party service authentication. On the AZ-204 exam, this scenario tests your understanding of how managed identities interact with Azure RBAC versus Key Vault access policies; a common trap is confusing the broader Key Vault Reader role, which grants read access to vault metadata but not secrets, or mistakenly using the Key Vault Contributor role which provides full management. Remember the memory tip: “Secrets User” means you can use the secret but not change it—think “read-only for secrets, not the vault itself.”
⚠ Common exam trap
Candidates often confuse management plane roles (like 'Key Vault Contributor' or 'Key Vault Reader') with data plane roles, assuming that any 'Reader' or 'Contributor' role at the vault scope grants access to secret values, when in fact they only control the vault resource itself, not the secrets.
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
✓
Key Vault Secrets User
The 'Key Vault Secrets User' role grants the minimum required permission—'Microsoft.KeyVault/vaults/secrets/getSecret/action'—for a managed identity to read a secret from Azure Key Vault. This role is specifically designed for read-only access to secrets, aligning with the principle of least privilege for the app's need to retrieve a secret for third-party service authentication.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Key Vault Reader
Why it's wrong here
This role allows listing vaults and reading metadata but does not grant access to read secret values.
- ✗
Key Vault Secrets Officer
Why it's wrong here
This role permits full control over secrets (create, update, delete), which is more than the required read‑only access.
- ✓
Key Vault Secrets User
Why this is correct
This role provides read access to secret values, meeting the requirement with the minimum permissions.
- ✗
Key Vault Contributor
Why it's wrong here
This role manages the Key Vault resource itself but does not grant data plane access to secrets.
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
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.
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.
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 →
Same concept, more angles
3 more ways this is tested on AZ-204
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. You have an Azure App Service web app with a system-assigned managed identity. You need to grant it permission to read secrets from an Azure Key Vault. Which RBAC role should you assign to the managed identity at the Key Vault scope?
easy- ✓ A.Key Vault Secrets User
- B.Key Vault Reader
- C.Key Vault Crypto User
- D.Contributor
Why A: The system-assigned managed identity needs to read secrets from Key Vault. The 'Key Vault Secrets User' role grants exactly that permission — it allows the identity to perform secret read operations (Get, List) on the secrets in the vault. This is the correct RBAC role for read-only access to secrets, as opposed to keys or certificates.
Variation 2. You have an Azure App Service web app that uses a system-assigned managed identity. The app needs to read a secret stored in Azure Key Vault. You need to grant the app the minimum required permissions to access the secret. Which RBAC role should you assign to the managed identity at the Key Vault scope?
medium- A.Key Vault Reader
- ✓ B.Key Vault Secrets User
- C.Key Vault Secrets Officer
- D.Contributor
Why B: The Key Vault Secrets User role grants the minimum required permission to read secrets from Azure Key Vault. This role provides the 'Microsoft.KeyVault/vaults/secrets/getSecret/action' permission, which is exactly what the app needs to retrieve the secret value. It does not grant any write or management capabilities, adhering to the principle of least privilege.
Variation 3. You have an Azure App Service that uses a system-assigned managed identity. You need to grant it permission to read a secret from Azure Key Vault. Which RBAC role should you assign at the Key Vault scope?
medium- A.Key Vault Reader
- ✓ B.Key Vault Secrets User
- C.Key Vault Contributor
- D.Key Vault Certificate User
Why B: The system-assigned managed identity needs to read a secret from Azure Key Vault. The 'Key Vault Secrets User' RBAC role grants exactly that permission — the ability to read secret contents. This is the least-privilege role that allows the 'Microsoft.KeyVault/vaults/secrets/read' action, which is required for reading secret values.
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.