New-AzCloudServiceDiagnosticsExtension

Create a in-memory object for Diagnostics Extension

Syntax

New-AzCloudServiceDiagnosticsExtension
   [[-Subscription] <String>]
   [-Name] <String>
   [-ResourceGroupName] <String>
   [-CloudServiceName] <String>
   [-DiagnosticsConfigurationPath] <String>
   [-StorageAccountName] <String>
   [-StorageAccountKey] <String>
   [[-TypeHandlerVersion] <String>]
   [[-RolesAppliedTo] <String[]>]
   [[-AutoUpgradeMinorVersion] <Boolean>]
   [<CommonParameters>]

Description

Create a in-memory object for Diagnostics Extension

Examples

Example 1: Create diagnostics extension object

$storageAccountKey = Get-AzStorageAccountKey -ResourceGroupName "ContosOrg" -Name "ContosSA"
$configFile = "<WAD configuration file path>"
$extension = New-AzCloudServiceDiagnosticsExtension -Name "WADExtension" -ResourceGroupName "ContosOrg" -CloudServiceName "ContosCS" -StorageAccountName "ContosSA" -StorageAccountKey $storageAccountKey[0].Value -DiagnosticsConfigurationPath $configFile -TypeHandlerVersion "1.5" -AutoUpgradeMinorVersion $true

This command creates diagnostics extension object which is used for creating or updating a cloud service. For more details see New-AzCloudService.

Parameters

-AutoUpgradeMinorVersion

Auto upgrade minor version.

Type:Boolean
Position:10
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CloudServiceName

Name of Cloud Service.

Type:String
Position:4
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DiagnosticsConfigurationPath

Specifies the configuration for Azure Diagnostics. You can download the schema by using the following command: (Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' -ProviderNamespace 'Microsoft.Azure.Diagnostics').PublicConfigurationSchema | Out-File -Encoding utf8 -FilePath 'WadConfig.xsd'

Type:String
Position:5
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of Diagnostics Extension.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Resource Group name of Cloud Service.

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RolesAppliedTo

Roles applied to.

Type:String[]
Position:9
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageAccountKey

Storage Account Key.

Type:String
Position:7
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StorageAccountName

Name of the Storage Account.

Type:String
Position:6
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Subscription

Subscription.

Type:String
Position:2
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TypeHandlerVersion

Specifies the version of the extension.

Type:String
Position:8
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Extension