< Back

Set-AzureVMDiagnosticsExtension

Wed Jan 30, 2019 5:54 pm

NAME Set-AzureVMDiagnosticsExtension



SYNOPSIS

Configures the Azure Diagnostics extension on a virtual machine.





SYNTAX

Set-AzureVMDiagnosticsExtension [-DiagnosticsConfigurationPath] <String> [[-StorageAccountName] <String>] [[-StorageAccountKey] <String>]

[[-StorageAccountEndpoint] <String>] [[-StorageContext] <AzureStorageContext>] [[-Version] <String>] [[-Disable]] [[-ReferenceName] <String>] -VM

<IPersistentVM> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]





DESCRIPTION

The Set-AzureVMDiagnosticsExtension cmdlet configures the Microsoft Azure Diagnostics extension on a virtual machine.





PARAMETERS

-DiagnosticsConfigurationPath <String>

Specifies a path for the diagnostics configuration.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-StorageAccountName <String>





Required? false

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageAccountKey <String>





Required? false

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageAccountEndpoint <String>





Required? false

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageContext <AzureStorageContext>

Specifies an Azure storage context.



Required? false

Position? 4

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Version <String>

Specifies the extension version as a string.



Required? false

Position? 5

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Disable [<SwitchParameter>]

Indicates that this cmdlet disables the diagnostics extension on the virtual machine.



Required? false

Position? 6

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VM <IPersistentVM>

Specifies the persistent virtual machine object.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue, ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReferenceName <String>

Specifies the reference name for the diagnostics extension.



Required? false

Position? 7

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Create a virtual machine with Azure Diagnostics extension applied --------------------------



PS C:\\>$VM = New-AzureVMConfig -Name $VM -InstanceSize Small -ImageName $VMImage

PS C:\\> $VM = Add-AzureProvisioningConfig -VM $VM -AdminUsername $Username -Password $Password -Windows

PS C:\\> $VM = Set-AzureVMDiagnosticsExtension -DiagnosticsConfigurationPath $Config_Path -Version "1.*" -VM $VM -StorageContext $Storage_Context

PS C:\\> New-AzureVM -Location $Location -ServiceName $Service_Name -VM $VM



These commands enable the Azure Diagnostics extension on a virtual machine.

-------------------------- Example 2: Enable an Azure Diagnostics extension on an existing virtual machine --------------------------



PS C:\\>$VM = Get-AzureVM -ServiceName $Service_Name -Name $VM_Name

PS C:\\> $VM_Update = Set-AzureVMDiagnosticsExtension -DiagnosticsConfigurationPath $Config_Path -Version "1.*" -VM $VM -StorageContext $Storage_Context

PS C:\\> Update-AzureVM -ServiceName $Service_Name -Name $VM_Name -VM $VM_Update.VM



The first command uses the Get-AzureVM cmdlet to get a virtual machine.



RELATED LINKS

Get-AzureVMDiagnosticsExtension

Remove-AzureVMDiagnosticsExtension

Update-AzureVM