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?
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.
Why this answer
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.
Why the other options are wrong
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.
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 would these options actually 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.
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.
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 pick the wrong answer
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.
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.