< Back
Set-AzureRmVMDiagnosticsExtension
Post
NAME Set-AzureRmVMDiagnosticsExtension
SYNOPSIS
Configures the Azure diagnostics extension on a virtual machine.
SYNTAX
Set-AzureRmVMDiagnosticsExtension [-ResourceGroupName] <String> [-VMName] <String> [[-AutoUpgradeMinorVersion] <Boolean>]
[-DiagnosticsConfigurationPath] <String> [[-StorageAccountName] <String>] [[-StorageAccountKey] <String>] [[-StorageAccountEndpoint] <String>]
[[-StorageContext] <IStorageContext>] [[-Location] <String>] [[-Name] <String>] [[-TypeHandlerVersion] <String>] [-DefaultProfile
<IAzureContextContainer>] [<CommonParameters>]
DESCRIPTION
The Set-AzureRmVMDiagnosticsExtension cmdlet configures the Azure diagnostics extension on a virtual machine.
PARAMETERS
-AutoUpgradeMinorVersion <Boolean>
Indicates whether this cmdlet allows the Azure guest agent to automatically update the extension to a newer minor version.
Required? false
Position? 10
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DiagnosticsConfigurationPath <String>
Specifies the path of the configuration file.
Required? true
Position? 2
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Location <String>
Specifies the location of the virtual machine.
Required? false
Position? 7
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of an extension.
Required? false
Position? 8
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of the resource group of the virtual machine.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-StorageAccountEndpoint <String>
Specifies the storage account endpoint.
Required? false
Position? 5
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-StorageAccountKey <String>
Specifies the storage account key.
Required? false
Position? 4
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-StorageAccountName <String>
Specifies the storage account name.
Required? false
Position? 3
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-StorageContext <IStorageContext>
Specifies the Azure storage context.
Required? false
Position? 6
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-TypeHandlerVersion <String>
Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with
a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.
Required? false
Position? 9
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-VMName <String>
Specifies the name of the virtual machine on which this cmdlet operates.
Required? true
Position? 1
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 (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse
NOTES
Example 1: Enable diagnostics using a storage account specified in a diagnostics configuration file
PS C:\\> Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup01" -VMName "VirtualMachine02" -DiagnosticsConfigurationPath
"diagnostics_publicconfig.xml"
This command uses a diagnostics configuration file to enable diagnostics. The file diagnostics_publicconfig.xml contains the public XML
configuration for the diagnostics extension including the name of the storage account to which diagnostics data will be sent. The diagnostics
storage account must be in the same subscription as the virtual machine.
Example 2: Enable diagnostics using a storage account name
PS C:\\> Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup1" -VMName "VirtualMachine2" -DiagnosticsConfigurationPath
diagnostics_publicconfig.xml -StorageAccountName "MyStorageAccount"
This command uses the storage account name to enable diagnostics. If the diagnostics configuration does not specify a storage account name or if
you want to override the diagnostics storage account name specified in the configuration file, use the StorageAccountName parameter. The
diagnostics storage account must be in the same subscription as the virtual machine.
Example 3: Enable diagnostics using storage account name and key
PS C:\\> Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup01" -VMName "VirtualMachine02" -DiagnosticsConfigurationPath
"diagnostics_publicconfig.xml" -StorageAccountName "MyStorageAccount" -StorageAccountKey $storage_key
This command uses the storage account name and key to enable diagnostics. If the diagnostics storage account is in a different subscription than
the virtual machine then enable sending diagnostics data to that storage account by explicitly specifying its name and key.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... sextension
Get-AzureRmVMDiagnosticsExtension
Get-AzureRmVMExtensionImage
Remove-AzureRmVMDiagnosticsExtension
SYNOPSIS
Configures the Azure diagnostics extension on a virtual machine.
SYNTAX
Set-AzureRmVMDiagnosticsExtension [-ResourceGroupName] <String> [-VMName] <String> [[-AutoUpgradeMinorVersion] <Boolean>]
[-DiagnosticsConfigurationPath] <String> [[-StorageAccountName] <String>] [[-StorageAccountKey] <String>] [[-StorageAccountEndpoint] <String>]
[[-StorageContext] <IStorageContext>] [[-Location] <String>] [[-Name] <String>] [[-TypeHandlerVersion] <String>] [-DefaultProfile
<IAzureContextContainer>] [<CommonParameters>]
DESCRIPTION
The Set-AzureRmVMDiagnosticsExtension cmdlet configures the Azure diagnostics extension on a virtual machine.
PARAMETERS
-AutoUpgradeMinorVersion <Boolean>
Indicates whether this cmdlet allows the Azure guest agent to automatically update the extension to a newer minor version.
Required? false
Position? 10
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DiagnosticsConfigurationPath <String>
Specifies the path of the configuration file.
Required? true
Position? 2
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Location <String>
Specifies the location of the virtual machine.
Required? false
Position? 7
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of an extension.
Required? false
Position? 8
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of the resource group of the virtual machine.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-StorageAccountEndpoint <String>
Specifies the storage account endpoint.
Required? false
Position? 5
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-StorageAccountKey <String>
Specifies the storage account key.
Required? false
Position? 4
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-StorageAccountName <String>
Specifies the storage account name.
Required? false
Position? 3
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-StorageContext <IStorageContext>
Specifies the Azure storage context.
Required? false
Position? 6
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-TypeHandlerVersion <String>
Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with
a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.
Required? false
Position? 9
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-VMName <String>
Specifies the name of the virtual machine on which this cmdlet operates.
Required? true
Position? 1
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 (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse
NOTES
Example 1: Enable diagnostics using a storage account specified in a diagnostics configuration file
PS C:\\> Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup01" -VMName "VirtualMachine02" -DiagnosticsConfigurationPath
"diagnostics_publicconfig.xml"
This command uses a diagnostics configuration file to enable diagnostics. The file diagnostics_publicconfig.xml contains the public XML
configuration for the diagnostics extension including the name of the storage account to which diagnostics data will be sent. The diagnostics
storage account must be in the same subscription as the virtual machine.
Example 2: Enable diagnostics using a storage account name
PS C:\\> Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup1" -VMName "VirtualMachine2" -DiagnosticsConfigurationPath
diagnostics_publicconfig.xml -StorageAccountName "MyStorageAccount"
This command uses the storage account name to enable diagnostics. If the diagnostics configuration does not specify a storage account name or if
you want to override the diagnostics storage account name specified in the configuration file, use the StorageAccountName parameter. The
diagnostics storage account must be in the same subscription as the virtual machine.
Example 3: Enable diagnostics using storage account name and key
PS C:\\> Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup01" -VMName "VirtualMachine02" -DiagnosticsConfigurationPath
"diagnostics_publicconfig.xml" -StorageAccountName "MyStorageAccount" -StorageAccountKey $storage_key
This command uses the storage account name and key to enable diagnostics. If the diagnostics storage account is in a different subscription than
the virtual machine then enable sending diagnostics data to that storage account by explicitly specifying its name and key.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... sextension
Get-AzureRmVMDiagnosticsExtension
Get-AzureRmVMExtensionImage
Remove-AzureRmVMDiagnosticsExtension