Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Set-AzureServiceDiagnosticsExtension

Set-AzureServiceDiagnosticsExtension

microsoft.windowsazure.commands.servicemanagement.dll

Synopsis

This cmdlet enables diagnostics extension on specified role(s) or all roles on a deployed service or at deployment.

Syntax

Set-AzureServiceDiagnosticsExtension [-ServiceName] [-Slot] [-Role] [-X509Certificate] [-ThumbprintAlgorithm] [-StorageContext] [-DiagnosticsConfigurationPath] [<CommonParameters>]

Set-AzureServiceDiagnosticsExtension [-ServiceName] [-Slot] [-Role] [-CertificateThumbprint] [-ThumbprintAlgorithm] [-StorageContext] [-DiagnosticsConfigurationPath] [<CommonParameters>]

Detailed Description

This cmdlet enables diagnostics extension on specified role(s) or all roles on a deployed service or at deployment.

Parameters

-ServiceName <String>

Specifies the Microsoft Azure service name of the deployment.

Aliases

None

Required?

false

Position

0

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Slot <String>

Specifies the environment of the deployment to modify. Supported values are "Production" or "Staging".

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Role <String[]>

An optional array of roles to specify the diagnostics configuration for. If not specified the diagnostics configuration is applied as the default configuration for all roles.

Aliases

None

Required?

false

Position

2

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-X509Certificate <X509Certificate2>

An x509 certificate that when specified will be automatically uploaded to the cloud service and used for encrypting the extension private configuration.

Aliases

None

Required?

false

Position

3

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ThumbprintAlgorithm <String>

Thumbprint hashing algorithm which is used with the thumbprint to identify the certificate. This parameter is optional and the default is sha1.

Aliases

None

Required?

false

Position

4

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-StorageContext <AzureStorageContext>

Aliases

None

Required?

true

Position

5

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-DiagnosticsConfigurationPath <String>

Aliases

None

Required?

false

Position

6

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-CertificateThumbprint <String>

A certificate thumbprint to use for encrypting the private configuration. If not specified a certificate will be created for you. This certificate has to already exist in the certificate store.

Aliases

None

Required?

false

Position

3

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-DiagnosticsConfiguration <xmldocument>

Configuration for Microsoft Azure diagnostics. The schema is: <?xml version="1.0" encoding="utf-8"?> <xs:schema id="DiagnosticsConfigSchema" targetNamespace="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration" xmlns:wad="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:simpleType name="PositiveDuration"> <xs:restriction base="xs:duration"> <xs:minInclusive value="PT0S" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="LogLevel"> <xs:restriction base="xs:string"> <xs:enumeration value="Undefined" /> <xs:enumeration value="Verbose" /> <xs:enumeration value="Information" /> <xs:enumeration value="Warning" /> <xs:enumeration value="Error" /> <xs:enumeration value="Critical" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="ContainerName"> <xs:restriction base="xs:string"> <xs:pattern value="[a-z0-9][a-z0-9\-]{1,61}[a-z0-9]" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="locale"> <xs:restriction base="xs:string"> </xs:restriction> </xs:simpleType> <xs:simpleType name="displayName"> <xs:restriction base="xs:string"> </xs:restriction> </xs:simpleType> <xs:simpleType name="AbsolutePathWithEnvironmentExpansion"> <xs:restriction base="xs:string"> <xs:pattern value="([a-zA-Z]:\)?([^&lt;&gt;:&quot;/|?*]+)*(\)?" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="RelativePathWithEnvironmentExpansion"> <xs:restriction base="xs:string"> <xs:pattern value="([^&lt;&gt;:&quot;/\|?*]+)(\([^&lt;&gt;:&quot;/\|?*]+))*(\)?" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="PerformanceCounterPath"> <xs:restriction base="xs:string"> <xs:pattern value="\.*" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="EventNameType"> <xs:restriction base="xs:string"> <xs:pattern value="[a-zA-Z][_a-zA-Z0-9]{0,59}" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="CrashDumpType" > <xs:restriction base="xs:string"> <xs:enumeration value="Mini"/> <xs:enumeration value="Full"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="NamedElementNameString"> <xs:restriction base="xs:string"> <xs:pattern value="^[a-zA-Z_][^\\/\:\*\?\&quot;\&lt;\&gt;\|]*(?&lt;![\.\s])$" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="format"> <xs:restriction base="xs:string"> <xs:enumeration value="Manifest" /> <xs:enumeration value="EventSource" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="directoryQuotaPercentage"> <xs:restriction base="xs:integer"> <xs:minInclusive value="0"/> <xs:maxInclusive value="100"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="guidType"> <xs:annotation> <xs:documentation> A GUID. Brackets (and only brakets) before and/or after are ignored. e.g. {12345678-1234-1234-1234-123456789abc}, {12345678-1234-1234-1234-123456789abc, 12345678-1234-1234-1234-123456789abc} and 12345678-1234-1234-1234-123456789abc are valid. </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> <xs:pattern value="^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$"/> </xs:restriction> </xs:simpleType> <xs:attributeGroup name="BasicConfiguration"> <xs:attribute name="scheduledTransferPeriod" type="PositiveDuration" use="optional" default="PT0S"> <xs:annotation> <xs:documentation> The interval between scheduled transfers for this data, rounded up to the nearest minute. </xs:documentation> </xs:annotation> </xs:attribute> </xs:attributeGroup> <xs:attributeGroup name="ETWConfiguration"> <xs:attribute name="scheduledTransferPeriod" type="PositiveDuration" use="optional" default="PT0S"> <xs:annotation> <xs:documentation> The interval between scheduled transfers for this data, rounded up to the nearest minute. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="scheduledTransferLogLevelFilter" type="LogLevel" use="optional" default="Undefined"> <xs:annotation> <xs:documentation> The minimum log severity to transfer. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="provider" type="xs:string" use="required"> <xs:annotation> <xs:documentation> The provider guid or class name for event source </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="scheduledTransferKeywordFilter" type="xs:unsignedLong" use="optional" default="0" > <xs:annotation> <xs:documentation> The keyword to filter by </xs:documentation> </xs:annotation> </xs:attribute> </xs:attributeGroup> <xs:attributeGroup name="LogLevel"> <xs:attribute name="scheduledTransferLogLevelFilter" type="LogLevel" use="optional" default="Undefined"> <xs:annotation> <xs:documentation> The minimum log severity to transfer. </xs:documentation> </xs:annotation> </xs:attribute> </xs:attributeGroup> <xs:attributeGroup name="DirectoryAttributes"> <xs:attribute name="containerName" type="wad:ContainerName" use="required"> <xs:annotation> <xs:documentation> The name of the container where the content of the directory is to be transferred. </xs:documentation> </xs:annotation> </xs:attribute> </xs:attributeGroup> <xs:attributeGroup name="CrashDumpConfiguration"> <xs:attribute name="directoryQuotaPercentage" type="directoryQuotaPercentage" use="optional" default="10"> <xs:annotation> <xs:documentation> The percentage of directory quota used by crashdumps </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="dumpType" type="CrashDumpType" use="optional" default="Mini"> <xs:annotation> <xs:documentation> The type of crashdump </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="containerName" type="wad:ContainerName" use="optional" default="wad-crashdumps"> <xs:annotation> <xs:documentation> The blob container to store the crashdumps </xs:documentation> </xs:annotation> </xs:attribute> </xs:attributeGroup> <xs:complexType name="LogsBase"> <xs:attributeGroup ref="BasicConfiguration" /> </xs:complexType> <xs:complexType name="EtwEventsBase"> <xs:attributeGroup ref="ETWConfiguration" /> </xs:complexType> <xs:complexType name ="CrashDumpsBase"> <xs:attributeGroup ref="CrashDumpConfiguration"/> </xs:complexType> <xs:complexType name="EtwManifestProviderConfiguration"> <xs:complexContent> <xs:extension base="EtwEventsBase"> <xs:sequence> <xs:element maxOccurs="unbounded" name="Event" minOccurs="0"> <xs:complexType> <xs:attribute name="id" type="xs:int" use="required"> <xs:annotation> <xs:documentation> The id of the ETW event that is to be collected </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="eventDestination" type="EventNameType" use="optional"> <xs:annotation> <xs:documentation> The name of the table in which the event data will be stored. If this attribute is not defined the table's name is 'Event'+'MD5 of the provider'+EventId#. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="DefaultEvents" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:attribute name="eventDestination" type="EventNameType" use="optional"> <xs:annotation> <xs:documentation> The name of the table in which the event data will be stored. If this attribute is not defined the table's name is 'Default'+'MD5 of the provider'+EventId#. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="EtwEventSourceProviderConfiguration"> <xs:complexContent> <xs:extension base="EtwEventsBase"> <xs:sequence> <xs:element maxOccurs="unbounded" name="Event" minOccurs="0"> <xs:complexType> <xs:attribute name="id" type="xs:int" use="required"> <xs:annotation> <xs:documentation> The id of the ETW event that is to be collected </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="eventDestination" type="EventNameType" use="optional"> <xs:annotation> <xs:documentation> The name of the table in which the event data will be stored. If this attribute is not defined the table's name is 'Event'+'MD5 of the provider'+EventId#. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="DefaultEvents" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:attribute name="eventDestination" type="EventNameType" use="optional"> <xs:annotation> <xs:documentation> The name of the table in which the event data will be stored. If this attribute is not defined the table's name is 'Default'+'MD5 of the provider'+EventId#. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="EtwProviders"> <xs:sequence maxOccurs="unbounded"> <xs:element name="EtwEventSourceProviderConfiguration" type="EtwEventSourceProviderConfiguration" minOccurs="0" > <xs:annotation> <xs:documentation> ETW collection by event source </xs:documentation> </xs:annotation> </xs:element> <xs:element name="EtwManifestProviderConfiguration" type="EtwManifestProviderConfiguration" minOccurs="0"> <xs:annotation> <xs:documentation> ETW collection by manifest </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="CrashDumpConfiguration"> <xs:attribute name="processName" type="xs:string" use="required"> <xs:annotation> <xs:documentation> The name of the process to to monitor for crashes. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <xs:complexType name="CrashDumps"> <xs:complexContent> <xs:extension base="CrashDumpsBase"> <xs:sequence maxOccurs="unbounded"> <xs:element name="CrashDumpConfiguration" type="CrashDumpConfiguration"> <xs:annotation> <xs:documentation> The crashdump to collect </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="DiagnosticInfrastructureLogs"> <xs:complexContent> <xs:extension base="LogsBase"> <xs:attributeGroup ref="LogLevel" /> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="DirectoryBase" /> <xs:complexType name="DirectoryAbsolute"> <xs:complexContent> <xs:extension base="DirectoryBase"> <xs:attribute name="path" type="AbsolutePathWithEnvironmentExpansion" use="required"> <xs:annotation> <xs:documentation> The absolute path to the directory to monitor. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="expandEnvironment" type="xs:boolean" use="required"> <xs:annotation> <xs:documentation> If true, then environment variables in the path will be expanded. </xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="DirectoryLocalResource"> <xs:complexContent> <xs:extension base="DirectoryBase"> <xs:attribute name="relativePath" type="RelativePathWithEnvironmentExpansion" use="required"> <xs:annotation> <xs:documentation> The path relative to the local resource to monitor. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="name" type="NamedElementNameString" use="required"> <xs:annotation> <xs:documentation> The local resource that contains the directory to monitor. </xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="DirectoryConfiguration"> <xs:choice> <xs:element name="Absolute" type="DirectoryAbsolute"> <xs:annotation> <xs:documentation> The absolute path to the directory to monitor. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="LocalResource" type="DirectoryLocalResource"> <xs:annotation> <xs:documentation> The path relative to a local resource to monitor. </xs:documentation> </xs:annotation> </xs:element> </xs:choice> <xs:attributeGroup ref="DirectoryAttributes" /> </xs:complexType> <xs:complexType name="SpecialLogDirectory"> <xs:attributeGroup ref="DirectoryAttributes" /> </xs:complexType> <xs:complexType name="DataSources"> <xs:sequence> <xs:element name="DirectoryConfiguration" type="DirectoryConfiguration" maxOccurs="unbounded"> <xs:annotation> <xs:documentation> The directory of log files to monitor. </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="Directories"> <xs:complexContent> <xs:extension base="LogsBase"> <xs:all> <xs:element name="IISLogs" type="SpecialLogDirectory" minOccurs="0"> <xs:annotation> <xs:documentation> The IIS log directory. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="FailedRequestLogs" type="SpecialLogDirectory" minOccurs="0"> <xs:annotation> <xs:documentation> The failed request log directory. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="DataSources" type="DataSources" minOccurs="0"> <xs:annotation> <xs:documentation> Additional log directories. </xs:documentation> </xs:annotation> </xs:element> </xs:all> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="annotation"> <xs:attribute name="displayName" type="displayName" use="required"> <xs:annotation> <xs:documentation> The display name for the performance counter. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="locale" type="locale" use="optional" default="en-US"> <xs:annotation> <xs:documentation> The locale for the performance counter diplay name. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <xs:complexType name="PerformanceCounterConfiguration"> <xs:sequence minOccurs="0"> <xs:element maxOccurs="unbounded" name="annotation" type="annotation"> <xs:annotation> <xs:documentation> The display name and locale for the performance counter </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> <xs:attribute name="counterSpecifier" type="PerformanceCounterPath" use="required"> <xs:annotation> <xs:documentation> The path to the performance counter to collect. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="sampleRate" type="PositiveDuration" use="required"> <xs:annotation> <xs:documentation> The rate at which the performance counter should be sampled. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="unit" type="xs:string" use="optional"> <xs:annotation> <xs:documentation> The unit for the performance counter for display purposes. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <xs:complexType name="PerformanceCounters"> <xs:complexContent> <xs:extension base="LogsBase"> <xs:sequence maxOccurs="unbounded"> <xs:element name="PerformanceCounterConfiguration" type="PerformanceCounterConfiguration"> <xs:annotation> <xs:documentation> The performance counter to collect. </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="DataSource"> <xs:attribute name="name" type="xs:string" use="required"> <xs:annotation> <xs:documentation> An XPath expression specifying the logs to collect. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <xs:complexType name="WindowsEventLog"> <xs:complexContent> <xs:extension base="LogsBase"> <xs:sequence maxOccurs="unbounded"> <xs:element name="DataSource" type="DataSource"> <xs:annotation> <xs:documentation> The event log to monitor. </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="DiagnosticMonitorConfiguration"> <xs:all> <xs:element name="DiagnosticInfrastructureLogs" type="DiagnosticInfrastructureLogs" minOccurs="0"> <xs:annotation> <xs:documentation> Configures the logs generated by the underlying diagnostics infrastructure. The diagnostic infrastructure logs are useful for troubleshooting the diagnostics system itself. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="Directories" type="Directories" minOccurs="0"> <xs:annotation> <xs:documentation> Describes the configuration of a directory to which file-based logs are written. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="PerformanceCounters" type="PerformanceCounters" minOccurs="0"> <xs:annotation> <xs:documentation> Configures performance counter collection. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="WindowsEventLog" type="WindowsEventLog" minOccurs="0"> <xs:annotation> <xs:documentation> Configures Windows event log collection. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="EtwProviders" type="EtwProviders" minOccurs="0"> <xs:annotation> <xs:documentation> Configures ETW event collection. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="CrashDumps" type="CrashDumps" minOccurs="0"> <xs:annotation> <xs:documentation> Configures crashdump collection. </xs:documentation> </xs:annotation> </xs:element> </xs:all> <xs:attribute name="overallQuotaInMB" type="xs:unsignedInt" use="optional" default="5120"> <xs:annotation> <xs:documentation> The total amount of file system storage allocated for all logging buffers. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="useProxyServer" type="xs:boolean" use="optional" default="true"> <xs:annotation> <xs:documentation> Force the Monitoring Agent to use the specified IE proxy server if specified. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <xs:element name="PublicConfig"> <xs:complexType> <xs:all> <xs:element name="WadCfg"> <xs:complexType> <xs:sequence> <xs:element name="DiagnosticMonitorConfiguration" type="DiagnosticMonitorConfiguration" minOccurs="1" maxOccurs="1" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="LocalResourceDirectory" minOccurs="0" maxOccurs="1" type="DirectoryAbsolute" /> <xs:element name="StorageAccount" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:all> </xs:complexType> </xs:element> </xs:schema>

Aliases

None

Required?

false

Position

5

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-StorageAccountName <string>

The name of the storage account diagnostics will use to store diagnostics data such as performance counter data and file logs.

Aliases

None

Required?

true

Position

4

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

PS C:\> Set-AzureServiceDiagnosticExtension -ServiceName $svc -StorageAccountName $name -DiagnosticConfiguration $wadConfigXML

-------------------------- EXAMPLE 2 --------------------------

Description

PS C:\> Set-AzureServiceDiagnosticExtension -ServiceName $svc -StorageAccountName $name -DiagnosticConfiguration $wadConfigXML -Role "WebRole1"

Unknown