共用方式為


New-AzureServiceDiagnosticsExtensionConfig

為指定的角色或所有角色產生診斷延伸模組的組態。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

New-AzureServiceDiagnosticsExtensionConfig
   [[-Role] <String[]>]
   [[-X509Certificate] <X509Certificate2>]
   [[-ThumbprintAlgorithm] <String>]
   [[-StorageAccountName] <String>]
   [[-StorageAccountKey] <String>]
   [[-StorageAccountEndpoint] <String>]
   [[-StorageContext] <AzureStorageContext>]
   [-DiagnosticsConfigurationPath] <String>
   [[-ExtensionId] <String>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
New-AzureServiceDiagnosticsExtensionConfig
   [[-Role] <String[]>]
   [-CertificateThumbprint] <String>
   [[-ThumbprintAlgorithm] <String>]
   [[-StorageAccountKey] <String>]
   [[-StorageAccountEndpoint] <String>]
   [[-StorageContext] <AzureStorageContext>]
   [-DiagnosticsConfigurationPath] <String>
   [[-ExtensionId] <String>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
New-AzureServiceDiagnosticsExtensionConfig
   [[-StorageAccountName] <String>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

New-AzureServiceDiagnosticsExtensionConfig Cmdlet 會針對指定的角色或所有角色產生診斷擴充功能的組態。

範例

範例 1:為雲端服務中的所有角色建立 Azure 診斷 擴充功能

PS C:\> $WadConfig = New-AzureServiceDiagnosticExtensionConfig -StorageContext $StorageContext -DiagnosticsConfigurationPath $WadConfigXML

此命令會為雲端服務中的所有角色建立 Azure 診斷 擴充功能。

範例 2:建立角色的 Azure 診斷 擴充功能

PS C:\> $WadConfig = New-AzureServiceDiagnosticExtensionConfig -StorageContext $StorageContext -DiagnosticsConfigurationPath $WadConfigXML -Role "WebRole1"

此命令會建立雲端服務中 WebRole01 角色的 Azure 診斷 擴充功能。

參數

-CertificateThumbprint

指定要用來加密私人組態的憑證指紋。 此憑證必須已存在於證書存儲中。 如果您未指定憑證,此 Cmdlet 會建立憑證。

類型:String
Position:1
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-DiagnosticsConfigurationPath

指定診斷組態路徑。

類型:String
Position:7
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-ExtensionId

指定延伸模組識別碼。

類型:String
Position:8
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-InformationAction

指定此 Cmdlet 如何回應資訊事件。

此參數可接受的值為:

  • 繼續
  • 忽略
  • 詢問
  • SilentlyContinue
  • 停止
  • 暫止
類型:ActionPreference
別名:infa
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InformationVariable

指定資訊變數。

類型:String
別名:iv
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Role

指定要為其指定診斷組態的選擇性角色陣列。 如果未指定診斷組態,則會套用為所有角色的預設組態。

類型:String[]
Position:0
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-StorageAccountEndpoint

指定記憶體帳戶端點。

類型:String
Position:5
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-StorageAccountKey

指定記憶體帳戶金鑰。

類型:String
Position:4
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-StorageAccountName

指定記憶體帳戶名稱。

類型:String
Position:3
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-StorageContext

指定 Azure 記憶體內容。

類型:AzureStorageContext
Position:6
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ThumbprintAlgorithm

指定指紋哈希演算法,此演算法會與指紋搭配使用,以識別憑證。 此參數是選擇性的,預設值為sha1。

類型:String
Position:2
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-X509Certificate

指定自動上傳至雲端服務的 X.509 憑證,並用於加密擴充功能私人組態。

類型:X509Certificate2
Position:1
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False