mediummultiple choiceObjective-mapped

Two Azure virtual machines run the same automation script and both need access to Key Vault and Storage. The script must keep working if one VM is redeployed, and the team wants the same identity to be usable by both VMs. What should the administrator use?

Question 1mediummultiple choice
Full question →

Two Azure virtual machines run the same automation script and both need access to Key Vault and Storage. The script must keep working if one VM is redeployed, and the team wants the same identity to be usable by both VMs. What should the administrator use?

Answer choices

Why each option matters

Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.

A

Distractor review

A system-assigned managed identity on each VM

This identity is tied to a single resource and cannot be shared across multiple VMs.

B

Best answer

A user-assigned managed identity attached to both VMs

A user-assigned identity is reusable, can be shared, and survives VM replacement or redeployment.

C

Distractor review

A service principal stored in a configuration file on the VMs

This introduces secret handling on the hosts and is less secure than a managed identity.

D

Distractor review

A storage account access key stored in the script

This only helps with storage and does not provide a secure identity for Key Vault access.

Common exam trap

Common exam trap: answer the scenario, not the keyword

Many certification questions include familiar terms but test a specific constraint. Read the exact wording before choosing an answer that is generally true but wrong for this case.

Technical deep dive

How to think about this question

This question should be treated as a scenario, not a definition check. Identify the problem, the constraint and the best action. Then compare each option against those facts.

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.
  • Use explanations to understand the rule behind the answer.

TExam Day Tips

  • Underline the problem statement mentally.
  • 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.

Related practice questions

Related AZ-104 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

More questions from this exam

Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.

FAQ

Questions learners often ask

What does this AZ-104 question test?

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 both VMs — A user-assigned managed identity is the best fit when multiple Azure resources must share the same identity and permissions. It is created as a standalone resource and can be attached to both VMs, which means the script can authenticate without storing credentials on either machine. Because the identity is independent of the VM lifecycle, it continues to work if one VM is reimaged, redeployed, or replaced. That makes it more resilient than a system-assigned identity. Why others are wrong: A system-assigned managed identity is bound to one VM, so it cannot be reused across both servers. A service principal stored in a file creates credential management risk and requires secret rotation. A storage account key is not a general-purpose identity and would not solve Key Vault authentication. The user-assigned managed identity is the only option that meets the sharing and lifecycle requirements cleanly.

What should I do if I get this AZ-104 question wrong?

Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.

Discussion

Loading comments…

Sign in to join the discussion.