You have 100 Azure VMs with system-assigned managed identities enabled and need to obtain each identity's objectId value. Which command should you run?
Choose an answer
Tap an option to check your answer.
Correct answer: az resource show.
Why this is the answer
The az resource show command is the correct choice because it can retrieve detailed information about any Azure resource, including its managed identity. When targeting a VM with a system-assigned managed identity, this command, combined with the appropriate resource ID, will return the identity details, including the objectId. az ad sp credential list is used for listing service principal credentials, not for retrieving the objectId of a managed identity. Get-AzVM is a PowerShell cmdlet for retrieving VM details but does not directly provide the managed identity's objectId in a readily accessible format for all VMs. Get-AzureADUser is for managing Azure Active Directory user objects, not Azure resource managed identities.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed