external help file | Module Name | online version | schema |
---|---|---|---|
Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml |
Az.Network |
2.0.0 |
Returns connectivity information for a specified source VM and a destination.
Test-AzNetworkWatcherConnectivity -NetworkWatcher <PSNetworkWatcher> -SourceId <String> [-SourcePort <Int32>]
[-DestinationId <String>] [-DestinationAddress <String>] [-DestinationPort <Int32>]
[-ProtocolConfiguration <PSNetworkWatcherProtocolConfiguration>] [-AsJob]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Test-AzNetworkWatcherConnectivity -NetworkWatcherName <String> -ResourceGroupName <String> -SourceId <String>
[-SourcePort <Int32>] [-DestinationId <String>] [-DestinationAddress <String>] [-DestinationPort <Int32>]
[-ProtocolConfiguration <PSNetworkWatcherProtocolConfiguration>] [-AsJob]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Test-AzNetworkWatcherConnectivity -Location <String> -SourceId <String> [-SourcePort <Int32>]
[-DestinationId <String>] [-DestinationAddress <String>] [-DestinationPort <Int32>]
[-ProtocolConfiguration <PSNetworkWatcherProtocolConfiguration>] [-AsJob]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
The Test-AzNetworkWatcherConnectivity cmdlet returns connectivity information for a specified source VM and a destination. If connectivity between the source and destination cannot be established, the cmdlet returns details about the issue.
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
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": []
}
]
In this example we test connectivity from a VM in Azure to www.bing.com.
Returns connectivity information for a specified source VM and a destination. (autogenerated)
Test-AzNetworkWatcherConnectivity -DestinationAddress 'bing.com' -DestinationPort 80 -NetworkWatcher <PSNetworkWatcher> -SourceId '/subscriptions/00000000-0000-0000-0000-00000000000000000/resourceGroups/ContosoRG/providers/Microsoft.Compute/virtualMachines/MultiTierApp0'
Run cmdlet in the background
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The credentials, account, tenant, and subscription used for communication with azure.
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The IP address or URI the resource to which a connection attempt will be made.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The ID of the resource to which a connection attempt will be made.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Port on which check connectivity will be performed.
Type: System.Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Location of the network watcher.
Type: System.String
Parameter Sets: SetByLocation
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The network watcher resource.
Type: Microsoft.Azure.Commands.Network.Models.PSNetworkWatcher
Parameter Sets: SetByResource
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
The name of network watcher.
Type: System.String
Parameter Sets: SetByName
Aliases: Name
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Protocol configuration on which check connectivity will be performed.
Type: Microsoft.Azure.Commands.Network.Models.PSNetworkWatcherProtocolConfiguration
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The name of the network watcher resource group.
Type: System.String
Parameter Sets: SetByName
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The ID of the resource from which a connectivity check will be initiated.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The source port from which a connectivity check will be performed.
Type: System.Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Keywords: azure, azurerm, arm, resource, connectivity, management, manager, network, networking, network watcher
New-AzNetworkWatcher Get-AzNetworkWatcher Remove-AzNetworkWatcher
Get-AzNetworkWatcherNextHop Get-AzNetworkWatcherSecurityGroupView Get-AzNetworkWatcherTopology Get-AzNetworkWatcherTroubleshootingResult
New-AzNetworkWatcherPacketCapture New-AzPacketCaptureFilterConfig Get-AzNetworkWatcherPacketCapture Remove-AzNetworkWatcherPacketCapture Stop-AzNetworkWatcherPacketCapture
Start-AzNetworkWatcherResourceTroubleshooting New-AzNetworkWatcherProtocolConfiguration Test-AzNetworkWatcherIPFlow Test-AzNetworkWatcherConnectivity Stop-AzNetworkWatcherConnectionMonitor Start-AzNetworkWatcherConnectionMonitor Set-AzNetworkWatcherConnectionMonitor Set-AzNetworkWatcherConfigFlowLog Remove-AzNetworkWatcherConnectionMonitor New-AzNetworkWatcherConnectionMonitor Get-AzNetworkWatcherReachabilityReport Get-AzNetworkWatcherReachabilityProvidersList Get-AzNetworkWatcherFlowLogStatus Get-AzNetworkWatcherConnectionMonitorReport Get-AzNetworkWatcherConnectionMonitor