AZ-104 Manage Azure Identities and Governance Practice Question
An Azure administrator deploys a Linux VM that runs an application needing to read secrets from Azure Key Vault. The security policy forbids storing passwords, certificates, or access tokens on the VM. The application will run only on this single VM. What should be enabled on the VM?
⚠ Common exam trap
It's easy for candidates to confuse SSH certificates (used for VM access) with Azure AD authentication tokens, or incorrectly assume that a user-assigned managed identity can be used without assignment to the VM.
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
✓
Enable a system-assigned managed identity on the VM.
A system-assigned managed identity enables the VM to authenticate to Azure Key Vault without storing any credentials on the VM. Azure automatically creates a service principal in Azure AD for the VM, and the application can obtain an access token from the Azure Instance Metadata Service (IMDS) endpoint (169.254.169.254) using that identity. This satisfies the security policy forbidding stored secrets because the identity is managed entirely by Azure and no passwords, certificates, or tokens are stored locally.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Store a service principal secret in a protected file and use it at startup.
Why it's wrong here
Storing a service principal secret (a password or client secret) in a protected file on the VM still places a credential in the VM's filesystem. Even if the file is encrypted or has restrictive permissions, the secret must be readable at startup and is exposed to anyone with root access or access to the underlying disk. This directly violates the explicit requirement of not storing secrets on the VM and is riskier than using a managed identity.
When this WOULD be correct
This option would be correct if the security policy allowed storing secrets on the VM and the application needed to authenticate using a service principal with a client secret, for example, when running on-premises or on a VM that cannot use managed identities.
- ✓
Enable a system-assigned managed identity on the VM.
Why this is correct
Enabling a system-assigned managed identity on the VM creates an Azure AD identity that is tied directly to the VM's lifecycle. The application can request an access token for Azure Key Vault using the Azure Instance Metadata Service (IMDS) endpoint at 169.254.169.254, which requires no hardcoded credentials. Azure automatically rotates and manages the identity's principal, so the VM never stores a secret on disk, fully satisfying the security requirement.
- ✗
Create a user-assigned managed identity and avoid assigning it to the VM.
Why it's wrong here
A user-assigned managed identity is a standalone Azure AD identity that must be explicitly assigned to a compute resource, such as a VM, in order for it to be usable. If the identity is created but not assigned to the VM, the VM has no token endpoint for that identity, and the application cannot obtain a token for it. The identity would simply exist unused and provide no authentication path to Key Vault, making this option ineffective.
When this WOULD be correct
If the question asked for a managed identity that can be pre-created and assigned to multiple VMs, or if the scenario required separating identity lifecycle from VM lifecycle (e.g., identity created by security team and later assigned to VMs), then creating a user-assigned managed identity would be correct.
- ✗
Use an SSH certificate to authenticate the app to Key Vault.
Why it's wrong here
SSH certificates are designed to authenticate users or hosts to SSH services, not to authorize API calls to Azure Key Vault. Key Vault authentication requires an Azure AD access token, typically obtained via the OAuth 2.0 client credentials flow or a managed identity. An SSH certificate does not map to an Azure AD identity and cannot be used to obtain a Key Vault token, so this approach would fail at runtime.
When this WOULD be correct
If the question required secure SSH access to the Linux VM without passwords, and the security policy allowed certificate-based authentication, enabling SSH certificate authentication would be correct. For example: 'An administrator needs to connect to a Linux VM securely without using passwords. What should be configured?'
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.
✓Enable a system-assigned managed identity on the VM.Correct answer▾
Why this is correct
Enabling a system-assigned managed identity on the VM creates an Azure AD identity that is tied directly to the VM's lifecycle. The application can request an access token for Azure Key Vault using the Azure Instance Metadata Service (IMDS) endpoint at 169.254.169.254, which requires no hardcoded credentials. Azure automatically rotates and manages the identity's principal, so the VM never stores a secret on disk, fully satisfying the security requirement.
✗Store a service principal secret in a protected file and use it at startup.Wrong answer — click to see why▾
Why this is wrong here
Storing a service principal secret in a protected file violates the security policy that forbids storing passwords, certificates, or access tokens on the VM. Managed identity eliminates the need for any stored credentials.
★ When this WOULD be the correct answer
This option would be correct if the security policy allowed storing secrets on the VM and the application needed to authenticate using a service principal with a client secret, for example, when running on-premises or on a VM that cannot use managed identities.
Why candidates choose this
Candidates may think that storing a secret in a protected file is a secure workaround, not realizing that managed identity provides a more secure and policy-compliant solution without any stored credentials.
✗Create a user-assigned managed identity and avoid assigning it to the VM.Wrong answer — click to see why▾
Why this is wrong here
The question requires the application to read secrets from Key Vault without storing credentials on the VM. A user-assigned managed identity not assigned to the VM cannot be used by the VM to authenticate; the identity must be assigned to the VM to be used.
★ When this WOULD be the correct answer
If the question asked for a managed identity that can be pre-created and assigned to multiple VMs, or if the scenario required separating identity lifecycle from VM lifecycle (e.g., identity created by security team and later assigned to VMs), then creating a user-assigned managed identity would be correct.
Why candidates choose this
Candidates may confuse user-assigned managed identities as a way to avoid storing credentials, not realizing that the identity must be assigned to the VM to be usable. They might think creating the identity is sufficient without assignment.
✗Use an SSH certificate to authenticate the app to Key Vault.Wrong answer — click to see why▾
Why this is wrong here
SSH certificates authenticate the user or system to the VM for SSH access, not the application to Azure Key Vault. The application needs an Azure AD identity to access Key Vault secrets, which SSH certificates cannot provide.
★ When this WOULD be the correct answer
If the question required secure SSH access to the Linux VM without passwords, and the security policy allowed certificate-based authentication, enabling SSH certificate authentication would be correct. For example: 'An administrator needs to connect to a Linux VM securely without using passwords. What should be configured?'
Why candidates choose this
Candidates may confuse SSH certificates with managed identities or think that any certificate can authenticate to Azure services, not realizing SSH certificates are only for VM access, not Azure AD authentication.
Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Privileged Identity Management (PIM)
Key term
Security
Security in IT is the practice of protecting systems, networks, and data from unauthorized access, damage, or theft.
Key term
Azure Key Vault
Azure Key Vault is a cloud service for securely storing and managing sensitive information like passwords, encryption keys, and certificates.
About these practice questions
Courseiva writes every AZ-104 question from scratch — 1,049 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-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.