AZ-801 · Question #128
You need to add Azure diagnostics extension to an existing virtual machine that is running windows to collect the monitoring data like event logs and performance counters. Which of the following…
The correct answer is B. Set-AzVMDiagnosticsExtension. Set-AzVMDiagnosticsExtension is the correct PowerShell cmdlet for adding or configuring the Azure Diagnostics extension on an existing Windows virtual machine.
Question
Options
- AGet-AzVMDiagnosticsExtension
- BSet-AzVMDiagnosticsExtension
- CInstall-AzVMDiagnosticsExtension
- DAdd-AzVMDiagnosticsExtension
How the community answered
(49 responses)- A4% (2)
- B92% (45)
- C2% (1)
- D2% (1)
Why each option
Set-AzVMDiagnosticsExtension is the correct PowerShell cmdlet for adding or configuring the Azure Diagnostics extension on an existing Windows virtual machine.
Get-AzVMDiagnosticsExtension retrieves the current diagnostics extension configuration from a VM but does not add or modify the extension.
The Set-AzVMDiagnosticsExtension cmdlet configures or installs the Azure Diagnostics extension on an existing VM by accepting the VM name, resource group, storage account, and a diagnostics configuration file, enabling collection of Windows Event Logs and performance counters.
Install-AzVMDiagnosticsExtension is not a valid cmdlet in the Az PowerShell module; no such command exists.
Add-AzVMDiagnosticsExtension is not a valid Az PowerShell cmdlet; the correct PowerShell verb for this configuration operation is Set, not Add.
Concept tested: Configuring Azure Diagnostics extension with PowerShell
Source: https://learn.microsoft.com/en-us/powershell/module/az.compute/set-azvmdiagnosticsextension
Topics
Community Discussion
No community discussion yet for this question.