CCPenX-Az practice question 9 of 10

A virtual machine has a system-assigned managed identity. From the VM shell, which Azure CLI command authenticates using that identity?

Full set: 31 questions
Answer options
A: az login --service-principal
B: az login --identity Correct answer
C: az account get-access-token --tenant
D: az ad signed-in-user show
Correct Answer:
B. az login --identity
Explanation

Detailed Solution: On an Azure VM with a system-assigned managed identity, run:
az login --identity
Then verify:
az account show
For a user-assigned managed identity, specify the client ID:
az login --identity --client-id
Microsoft’s Azure CLI documentation confirms az login --identity for system-assigned managed identities and --client-id, --object-id, or --resource-id for user-assigned identities. Correct answer:
B. az login --identity ================

Scroll to Top