- A
Create one user-assigned managed identity, attach it to all twenty Function Apps, and grant it the Cosmos DB Built-in Data Reader role
The role assignment on the user-assigned identity propagates instantly to all twenty Function Apps that reference it. Revoking the role assignment revokes access everywhere simultaneously. Adding a new Function App just requires attaching the existing identity — no new role grants are needed.
- B
Enable a system-assigned managed identity on each Function App and grant each identity the Cosmos DB Built-in Data Reader role
Why wrong: With system-assigned identities, there are twenty separate identity-to-role assignments. Revoking access requires removing twenty role assignments individually. This is exactly the operational overhead the security team wants to avoid.
- C
Create a service principal, store its client secret in Key Vault, and reference the secret from all twenty Function Apps via Key Vault references
Why wrong: This approach reintroduces a shared secret that must be rotated, stored securely, and distributed. Managed identities eliminate the need for any shared secrets. The user-assigned managed identity is the zero-secret equivalent of a shared service principal.
- D
Store the Cosmos DB connection string in Azure App Configuration and reference it from all twenty Function Apps
Why wrong: A shared connection string in App Configuration grants access to whoever holds the string. Revoking access requires rotating the connection string and updating App Configuration — which requires all twenty apps to reload. It also reintroduces the credential storage problem that managed identities solve.
Quick Answer
The answer is to create one user-assigned managed identity, attach it to all twenty Function Apps, and grant it the Cosmos DB Built-in Data Reader role. This design satisfies the requirement because a user-assigned managed identity is a standalone Azure resource that can be associated with multiple Azure resources, meaning you can attach the same identity to every function. When you assign the role to that single identity at the Cosmos DB account scope, any change—whether granting, revoking, or modifying permissions—applies centrally to all twenty functions simultaneously, eliminating the need to update each Function App individually. On the AZ-204 exam, this scenario tests your understanding of managed identity types and role-based access control (RBAC) delegation; a common trap is choosing a system-assigned identity, which is tied to a single resource and would require twenty separate role assignments. Remember the memory tip: “One identity to rule them all”—a single user-assigned identity centralizes access management across multiple resources.
AZ-204 Practice Question: User-assigned managed identity shared across…
This AZ-204 practice question tests your understanding of implement azure security. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. A key principle to apply: user-assigned managed identity. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Twenty Azure Functions across different teams all need read access to the same Azure Cosmos DB account. The security team wants to revoke or modify this access for all twenty functions at once without visiting each Function App individually. What managed identity design satisfies this requirement?
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
Create one user-assigned managed identity, attach it to all twenty Function Apps, and grant it the Cosmos DB Built-in Data Reader role
Option A is correct because a single user-assigned managed identity can be created once and then attached to all twenty Function Apps. Granting that identity the Cosmos DB Built-in Data Reader role at the Cosmos DB account scope means that revoking or modifying the role assignment centrally affects all functions simultaneously, without needing to visit each app individually.
Key principle: user-assigned managed identity
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Create one user-assigned managed identity, attach it to all twenty Function Apps, and grant it the Cosmos DB Built-in Data Reader role
Why this is correct
The role assignment on the user-assigned identity propagates instantly to all twenty Function Apps that reference it. Revoking the role assignment revokes access everywhere simultaneously. Adding a new Function App just requires attaching the existing identity — no new role grants are needed.
Related concept
user-assigned managed identity
- ✗
Enable a system-assigned managed identity on each Function App and grant each identity the Cosmos DB Built-in Data Reader role
Why it's wrong here
With system-assigned identities, there are twenty separate identity-to-role assignments. Revoking access requires removing twenty role assignments individually. This is exactly the operational overhead the security team wants to avoid.
- ✗
Create a service principal, store its client secret in Key Vault, and reference the secret from all twenty Function Apps via Key Vault references
Why it's wrong here
This approach reintroduces a shared secret that must be rotated, stored securely, and distributed. Managed identities eliminate the need for any shared secrets. The user-assigned managed identity is the zero-secret equivalent of a shared service principal.
- ✗
Store the Cosmos DB connection string in Azure App Configuration and reference it from all twenty Function Apps
Why it's wrong here
A shared connection string in App Configuration grants access to whoever holds the string. Revoking access requires rotating the connection string and updating App Configuration — which requires all twenty apps to reload. It also reintroduces the credential storage problem that managed identities solve.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often confuse system-assigned managed identities (which are tied to a single resource) with user-assigned managed identities (which can be shared across resources), leading them to choose Option B because they think 'managed identity' automatically means system-assigned, missing the central management requirement.
Detailed technical explanation
How to think about this question
User-assigned managed identities are Azure AD identities that can be assigned to multiple Azure resources, enabling centralized role-based access control (RBAC). When you assign the Cosmos DB Built-in Data Reader role (which maps to the 'Cosmos DB Built-in Data Reader' role definition ID '00000000-0000-0000-0000-000000000001') to the identity at the Cosmos DB account scope, all attached Function Apps inherit that permission. Under the hood, Azure AD issues tokens for the identity, and Cosmos DB validates the token against the assigned RBAC role, allowing read operations without any connection string or secret.
KKey Concepts to Remember
- user-assigned managed identity
- shared identity
- centralized permission management
- managed identity vs service principal
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
user-assigned managed identity
Real-world example
How this comes up in practice
A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
What to study next
Got this wrong? Here's your next step.
Review user-assigned managed identity, then practise related AZ-204 questions on the same topic to reinforce the concept.
- →
Implement Azure security — study guide chapter
Learn the concepts, then practise the questions
- →
Implement Azure security practice questions
Targeted practice on this topic area only
- →
All AZ-204 questions
997 questions across all exam domains
- →
Microsoft Azure Developer Associate AZ-204 study guide
Full concept coverage aligned to exam objectives
- →
AZ-204 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related AZ-204 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Develop Azure compute solutions practice questions
Practise AZ-204 questions linked to Develop Azure compute solutions.
Develop for Azure storage practice questions
Practise AZ-204 questions linked to Develop for Azure storage.
Implement Azure security practice questions
Practise AZ-204 questions linked to Implement Azure security.
Connect to and consume Azure services and third-party services practice questions
Practise AZ-204 questions linked to Connect to and consume Azure services and third-party services.
Monitor, troubleshoot, and optimize Azure solutions practice questions
Practise AZ-204 questions linked to Monitor, troubleshoot, and optimize Azure solutions.
AZ-204 fundamentals practice questions
Practise AZ-204 questions linked to AZ-204 fundamentals.
AZ-204 scenario practice questions
Practise AZ-204 questions linked to AZ-204 scenario.
AZ-204 troubleshooting practice questions
Practise AZ-204 questions linked to AZ-204 troubleshooting.
Practice this exam
Start a free AZ-204 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this AZ-204 question test?
Implement Azure security — This question tests Implement Azure security — user-assigned managed identity.
What is the correct answer to this question?
The correct answer is: Create one user-assigned managed identity, attach it to all twenty Function Apps, and grant it the Cosmos DB Built-in Data Reader role — Option A is correct because a single user-assigned managed identity can be created once and then attached to all twenty Function Apps. Granting that identity the Cosmos DB Built-in Data Reader role at the Cosmos DB account scope means that revoking or modifying the role assignment centrally affects all functions simultaneously, without needing to visit each app individually.
What should I do if I get this AZ-204 question wrong?
Review user-assigned managed identity, then practise related AZ-204 questions on the same topic to reinforce the concept.
What is the key concept behind this question?
user-assigned managed identity
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 11, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.