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
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
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.
Parameters
-AutoUpgradeMinorVersion
Indicates whether this cmdlet allows the Azure guest agent to automatically update the extension to a newer minor version.
Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism.
Specifies the version of the extension to use for this virtual machine.
To obtain the version, run the Get-AzVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.