Developing Solutions for Microsoft Azure — Question 75
You have 100 Azure virtual machines (VMs) with the system-assigned managed identity enabled.
You need to identify the value of the object ID attribute for each of the identities.
Which command should you use?
Answer options
- A. Get-AzVM
- B. Get-AzureADUserOwnedObject
- C. az ad sp credential list
- D. az resource show
Correct answer: D
Explanation
The correct command, 'az resource show', allows you to retrieve detailed information about a specific resource, including the object ID of the managed identity. The other options do not provide the necessary functionality to retrieve the object ID for managed identities; for example, 'Get-AzVM' retrieves VM information but not identity details.