Skip to content

Commit 48035cc

Browse files
(AzureCXP) MicrosoftDocs/azure-docs#42602
modified the commands for classic deployment
1 parent 618d8ca commit 48035cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ You can use the [Set-AzureVMDiagnosticsExtension](https://docs.microsoft.com/pow
6767

6868
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).
6969

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

7474
## Sample diagnostics configuration
7575
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)