New-AzNetworkWatcherProtocolConfiguration
Skapar ett nytt protokollkonfigurationsobjekt.
Syntax
New-AzNetworkWatcherProtocolConfiguration
-Protocol <String>
[-Method <String>]
[-Header <IDictionary>]
[-ValidStatusCode <Int32[]>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Cmdleten New-AzNetworkWatcherProtocolConfiguration skapar ett nytt protokollkonfigurationsobjekt. Det här objektet används för att begränsa protokollkonfigurationen under en anslutningskontrollsession med hjälp av de angivna kriterierna.
Exempel
Exempel 1: Testa Network Watcher Anslut ivity från en virtuell dator till en webbplats med protokollkonfiguration
$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": []
}
]
I det här exemplet testar vi anslutningen från en virtuell dator i Azure till www.bing.com.
Parametrar
-DefaultProfile
Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Header
lista över HTTP-huvuden
Type: | IDictionary |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Method
HTTP-metod
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Protocol
Protokolltyp
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ValidStatusCode
giltiga statuskoder
Type: | Int32[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indata
None
Utdata
PSNetworkWatcherProtocolConfiguration
Kommentarer
Nyckelord: azure, azurerm, arm, resource, management, manager, network, networking, watcher, packet, capture, traffic, filter
Relaterade länkar
- 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-AzNetworkWatcher Anslut ivity
- Stop-AzNetworkWatcher Anslut ionMonitor
- Start-AzNetworkWatcher Anslut ionMonitor
- Set-AzNetworkWatcher Anslut ionMonitor
- Set-AzNetworkWatcherConfigFlowLog
- Remove-AzNetworkWatcher Anslut ionMonitor
- New-AzNetworkWatcher Anslut ionMonitor
- Get-AzNetworkWatcherTroubleshootingResult
- Get-AzNetworkWatcherReachabilityReport
- Get-AzNetworkWatcherReachabilityProvidersList
- Get-AzNetworkWatcherFlowLogStatus
- Get-AzNetworkWatcher Anslut ionMonitorReport
- Get-AzNetworkWatcher Anslut ionMonitor
Azure PowerShell
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för