Skip to content

Commit d5803a4

Browse files
authored
Merge pull request #79802 from MicahMcKittrick-MSFT/patch-172
MicrosoftDocs/azure-docs#33371
2 parents 5e84b3b + e95ec1c commit d5803a4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

articles/virtual-machines/extensions/diagnostics-windows.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ The [Remove-AzVmDiagnosticsExtension](https://docs.microsoft.com/powershell/modu
6161
## Enable the diagnostics extension if you use the classic deployment model
6262
You can use the [Set-AzureVMDiagnosticsExtension](https://docs.microsoft.com/powershell/module/servicemanagement/azure/set-azurevmdiagnosticsextension) cmdlet to enable a diagnostics extension on a VM that you create through the classic deployment model. The following example shows how to create a new VM through the classic deployment model with the diagnostics extension enabled.
6363

64-
$VM = New-AzureVMConfig -Name $VM -InstanceSize Small -ImageName $VMImage
64+
$VM = New-AzVMConfig -Name $VM -InstanceSize Small -ImageName $VMImage
6565
$VM = Add-AzureProvisioningConfig -VM $VM -AdminUsername $Username -Password $Password -Windows
66-
$VM = Set-AzureVMDiagnosticsExtension -DiagnosticsConfigurationPath $Config_Path -VM $VM -StorageContext $Storage_Context
67-
New-AzureVM -Location $Location -ServiceName $Service_Name -VM $VM
66+
$VM = Set-AzVMDiagnosticsExtension -DiagnosticsConfigurationPath $Config_Path -VM $VM -StorageContext $Storage_Context
67+
New-AzVM -Location $Location -ServiceName $Service_Name -VM $VM
6868

6969
To enable the diagnostics extension on an existing VM that was created through the classic deployment model, first use the [Get-AzureVM](https://docs.microsoft.com/powershell/module/servicemanagement/azure/get-azurevm) cmdlet to get the VM configuration. Then update the VM configuration to include the diagnostics extension by using the [Set-AzureVMDiagnosticsExtension](https://docs.microsoft.com/powershell/module/servicemanagement/azure/set-azurevmdiagnosticsextension) cmdlet. Finally, apply the updated configuration to the VM by using [Update-AzureVM](https://docs.microsoft.com/powershell/module/servicemanagement/azure/update-azurevm).
7070

71-
$VM = Get-AzureVM -ServiceName $Service_Name -Name $VM_Name
72-
$VM_Update = Set-AzureVMDiagnosticsExtension -DiagnosticsConfigurationPath $Config_Path -VM $VM -StorageContext $Storage_Context
73-
Update-AzureVM -ServiceName $Service_Name -Name $VM_Name -VM $VM_Update.VM
71+
$VM = Get-AzVM -ServiceName $Service_Name -Name $VM_Name
72+
$VM_Update = Set-AzVMDiagnosticsExtension -DiagnosticsConfigurationPath $Config_Path -VM $VM -StorageContext $Storage_Context
73+
Update-AzVM -ServiceName $Service_Name -Name $VM_Name -VM $VM_Update.VM
7474

7575
## Sample diagnostics configuration
7676
The following XML can be used for the diagnostics public configuration with the above scripts. This sample configuration will transfer various performance counters to the diagnostics storage account, along with errors from the application, security, and system channels in the Windows event logs and any errors from the diagnostics infrastructure logs.

0 commit comments

Comments
 (0)