nerdexam
Microsoft

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.

Monitor and troubleshoot Windows Server environments

Question

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 cmdlets would you use?

Options

  • AGet-AzVMDiagnosticsExtension
  • BSet-AzVMDiagnosticsExtension
  • CInstall-AzVMDiagnosticsExtension
  • DAdd-AzVMDiagnosticsExtension

How the community answered

(49 responses)
  • A
    4% (2)
  • B
    92% (45)
  • C
    2% (1)
  • D
    2% (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.

AGet-AzVMDiagnosticsExtension

Get-AzVMDiagnosticsExtension retrieves the current diagnostics extension configuration from a VM but does not add or modify the extension.

BSet-AzVMDiagnosticsExtensionCorrect

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.

CInstall-AzVMDiagnosticsExtension

Install-AzVMDiagnosticsExtension is not a valid cmdlet in the Az PowerShell module; no such command exists.

DAdd-AzVMDiagnosticsExtension

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

#Azure Virtual Machines#Azure Diagnostics Extension#Azure PowerShell#Monitoring

Community Discussion

No community discussion yet for this question.

Full AZ-801 Practice