New-AzNetworkWatcherProtocolConfiguration
建立新的通訊協議組態物件。
語法
New-AzNetworkWatcherProtocolConfiguration
-Protocol <String>
[-Method <String>]
[-Header <IDictionary>]
[-ValidStatusCode <Int32[]>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
New-AzNetworkWatcherProtocolConfiguration Cmdlet 會建立新的通訊協議組態物件。 此物件可用來使用指定的準則,在聯機檢查會話期間限制通訊協定組態。
範例
範例 1:使用通訊協定設定測試從 VM 到網站的連線能力 網路監看員
$config = New-AzNetworkWatcherProtocolConfiguration -Protocol Http -Method Get -Header @{"accept"="application/json"} -ValidStatusCode @(200,202,204)
Test-AzNetworkWatcherConnectivity -NetworkWatcherName NetworkWatcher -ResourceGroupName NetworkWatcherRG -SourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ContosoRG/providers/Microsoft.Compute/virtualMachines/MultiTierApp0" -DestinationAddress "bing.com" -DestinationPort 80 -ProtocolConfiguration $config
ConnectionStatus : Reachable
AvgLatencyInMs : 4
MinLatencyInMs : 2
MaxLatencyInMs : 15
ProbesSent : 15
ProbesFailed : 0
Hops : [
{
"Type": "Source",
"Id": "f8cff464-e13f-457f-a09e-4dcd53d38a85",
"Address": "10.1.1.4",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ContosoRG/provi iders/Microsoft.Network/networkInterfaces/appNic0/ipConfigurations/ipconfig1",
"NextHopIds": [
"1034b1bf-0b1b-4f0a-93b2-900477f45485"
],
"Issues": []
},
{
"Type": "Internet",
"Id": "1034b1bf-0b1b-4f0a-93b2-900477f45485",
"Address": "13.107.21.200",
"ResourceId": "Internet",
"NextHopIds": [],
"Issues": []
}
]
在此範例中,我們會測試從 Azure 中的 VM 到 www.bing.com 的連線。
參數
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Header
HTTP 標頭清單
類型: | IDictionary |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Method
HTTP method (HTTP 方法)
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Protocol
通訊協定類型
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ValidStatusCode
有效的狀態代碼
類型: | Int32[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
None
輸出
PSNetworkWatcherProtocolConfiguration
備註
關鍵詞:azure, azurerm, arm, 資源, 管理, 管理員, 網路, 網路, 監看員, 封包, 擷取, 流量, 篩選
相關連結
- New-AzNetworkWatcher
- Get-AzNetworkWatcher
- Remove-AzNetworkWatcher
- Get-AzNetworkWatcherNextHop
- Get-AzNetworkWatcherSecurityGroupView
- Get-AzNetworkWatcherTopology
- Start-AzNetworkWatcherResourceTroubleshooting
- New-AzNetworkWatcherPacketCapture
- New-AzPacketCaptureFilterConfig
- Get-AzNetworkWatcherPacketCapture
- Remove-AzNetworkWatcherPacketCapture
- Stop-AzNetworkWatcherPacketCapture
- New-AzNetworkWatcherProtocolConfiguration
- Test-AzNetworkWatcherIPFlow
- Test-AzNetworkWatcherConnectivity
- Stop-AzNetworkWatcherConnectionMonitor
- Start-AzNetworkWatcherConnectionMonitor
- Set-AzNetworkWatcherConnectionMonitor
- Set-AzNetworkWatcherConfigFlowLog
- Remove-AzNetworkWatcherConnectionMonitor
- New-AzNetworkWatcherConnectionMonitor
- Get-AzNetworkWatcherTroubleshootingResult
- Get-AzNetworkWatcherReachabilityReport
- Get-AzNetworkWatcherReachabilityProvidersList
- Get-AzNetworkWatcherFlowLogStatus
- Get-AzNetworkWatcherConnectionMonitorReport
- Get-AzNetworkWatcherConnectionMonitor