The answer is a user-assigned managed identity, because it is an independent Azure resource that persists separately from any VM. Unlike a system-assigned identity, which is tied to a single VM’s lifecycle and is destroyed when the VM is deleted, a user-assigned managed identity can be created once and attached to multiple VMs across different resource groups. If one VM is deleted and recreated, the identity remains intact and can simply be reassigned to the new VM, ensuring continuous access to Azure resources. On the AZ-104 exam, this scenario tests your understanding of identity lifecycle management and the key distinction between identity types—a common trap is choosing system-assigned for simplicity, but that fails when VMs are recreated. Remember the memory tip: “User-assigned survives the recycle bin; system-assigned goes down with the ship.”
AZ-104 Manage Azure Identities and Governance Practice Question
This AZ-104 practice question tests your understanding of manage azure identities and governance. 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. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. 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.
Exhibit
Identity requirement:
- VM1 in rg-web
- VM2 in rg-api
- VM3 in rg-batch
- All three VMs need the same access to an Azure service
- The identity must not disappear when any one VM is deleted
Based on the exhibit, three VMs in different resource groups must use the same Azure identity, and the identity must continue working if one VM is deleted and recreated. What should you use?
Identity requirement:
- VM1 in rg-web
- VM2 in rg-api
- VM3 in rg-batch
- All three VMs need the same access to an Azure service
- The identity must not disappear when any one VM is deleted
A
A system-assigned managed identity on each VM.
Why wrong: A system-assigned identity is tied to one specific VM, so it does not meet the requirement for one shared identity across multiple VMs.
B
A user-assigned managed identity attached to all three VMs.
A user-assigned managed identity is correct because it is created independently from any single VM and can be attached to multiple resources. That makes it ideal when several VMs need the same identity and the identity must remain available even if one VM is deleted and recreated.
C
A service principal stored in the VM image.
Why wrong: A service principal stored in an image introduces secret management problems and does not provide the clean Azure-managed identity model described in the scenario.
D
A shared access signature assigned to the resource group.
Why wrong: A SAS token is not an identity and cannot be attached to VMs as a reusable Azure login mechanism.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
A user-assigned managed identity attached to all three VMs.
A user-assigned managed identity is an Azure resource that can be created independently and then assigned to multiple VMs. Because it persists as a separate resource in Azure, deleting and recreating a VM does not affect the identity; you simply reattach the same user-assigned identity to the new VM. This ensures the identity continues working across VM lifecycle changes, meeting the requirement for a shared, resilient identity.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
A system-assigned managed identity on each VM.
Why it's wrong here
A system-assigned identity is tied to one specific VM, so it does not meet the requirement for one shared identity across multiple VMs.
✓
A user-assigned managed identity attached to all three VMs.
Why this is correct
A user-assigned managed identity is correct because it is created independently from any single VM and can be attached to multiple resources. That makes it ideal when several VMs need the same identity and the identity must remain available even if one VM is deleted and recreated.
Related concept
Read the scenario before looking for a memorised answer.
✗
A service principal stored in the VM image.
Why it's wrong here
A service principal stored in an image introduces secret management problems and does not provide the clean Azure-managed identity model described in the scenario.
✗
A shared access signature assigned to the resource group.
Why it's wrong here
A SAS token is not an identity and cannot be attached to VMs as a reusable Azure login mechanism.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates confuse system-assigned managed identities (which are tied to VM lifecycle) with user-assigned managed identities (which are independent resources), leading them to choose Option A despite the requirement for identity persistence across VM deletion and recreation.
Trap categories for this question
Scenario analysis trap
A service principal stored in an image introduces secret management problems and does not provide the clean Azure-managed identity model described in the scenario.
Detailed technical explanation
How to think about this question
Under the hood, a user-assigned managed identity creates a service principal in Azure AD that is decoupled from any VM's lifecycle. When assigned to a VM, the Azure Instance Metadata Service (IMDS) endpoint provides the identity's client ID and certificate, allowing the VM to acquire tokens from Azure AD without any credential storage. This design supports scenarios like multi-tier applications where the same identity must access resources (e.g., Key Vault, SQL Database) even after individual VMs are replaced during scaling or patching.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
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
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
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.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this AZ-104 question in full detail.
Manage Azure Identities and Governance — This question tests Manage Azure Identities and Governance — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: A user-assigned managed identity attached to all three VMs. — A user-assigned managed identity is an Azure resource that can be created independently and then assigned to multiple VMs. Because it persists as a separate resource in Azure, deleting and recreating a VM does not affect the identity; you simply reattach the same user-assigned identity to the new VM. This ensures the identity continues working across VM lifecycle changes, meeting the requirement for a shared, resilient identity.
What should I do if I get this AZ-104 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
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 →
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. A bootstrap script must install software on three VMs, then download configuration files from Blob Storage. Security forbids secrets in templates or scripts, and the same authentication method must work after the VMs are rebuilt. Which two choices should you make? Select two.
hard
✓ A.Assign a user-assigned managed identity and attach it to each VM.
B.Store the storage account access key in a script variable.
✓ C.Use a Custom Script Extension to run the bootstrap commands at provisioning.
D.Create a separate local administrator account for the script to use.
E.Embed a SAS token directly in the Bicep parameters file.
Why A: Option A is correct because a user-assigned managed identity provides a secure, credential-free authentication method that persists across VM rebuilds. Unlike system-assigned managed identities, which are tied to a specific VM lifecycle and are lost when the VM is deleted, a user-assigned identity is a standalone Azure resource that can be reassigned to new VMs. This allows the bootstrap script to authenticate to Azure Blob Storage via Azure AD without storing any secrets, satisfying the security constraint.
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.
This AZ-104 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-104 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.