AZ-400 · Question #313
Hotspot Question You are using PowerShell to administer Azure Log Analytics workspaces. You need to list the available workspaces and their properties. How should you complete the command? To answer,
This question tests knowledge of the correct PowerShell cmdlet and syntax used to retrieve Azure Log Analytics workspaces and their properties. The command must use the Az module with the appropriate cmdlet for Log Analytics.
Question
Exhibit
Answer Area
- CommandletGet-AzResourceGet-AzResourceGroupGet-AzResourceProvider
- Parameter-ResourceGroupName-ResourceId-ResourceType
Explanation
This question tests knowledge of the correct PowerShell cmdlet and syntax used to retrieve Azure Log Analytics workspaces and their properties. The command must use the Az module with the appropriate cmdlet for Log Analytics.
Approach. The correct command is 'Get-AzOperationalInsightsWorkspace', which is part of the Az.OperationalInsights PowerShell module. This cmdlet lists all Log Analytics workspaces in a subscription or resource group along with their properties such as workspace ID, SKU, retention period, and provisioning state. The full command syntax would be: 'Get-AzOperationalInsightsWorkspace' optionally followed by '-ResourceGroupName <ResourceGroupName>' to scope results to a specific resource group. The module must be imported with 'Import-Module Az.OperationalInsights' if not already loaded.
Concept tested. Knowledge of Azure PowerShell Az module cmdlets, specifically the Az.OperationalInsights module and the 'Get-AzOperationalInsightsWorkspace' cmdlet used to enumerate and inspect Azure Log Analytics workspace properties via PowerShell.
Topics
Community Discussion
No community discussion yet for this question.
