Get-AzRoutingIntent
Retrieves a routing intent resource associated with a VirtualHub.
Syntax
ByVirtualHubName (Default)
Get-AzRoutingIntent
-ResourceGroupName <String>
-HubName <String>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByVirtualHubObject
Get-AzRoutingIntent
-VirtualHub <PSVirtualHub>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByVirtualHubResourceId
Get-AzRoutingIntent
-ParentResourceId <String>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Gets the specified routing intent that is associated with the specified virtual hub.
Examples
Example 1
New-AzVirtualWan -ResourceGroupName "testRg" -Name "testWan" -Location "westcentralus" -VirtualWANType "Standard" -AllowVnetToVnetTraffic -AllowBranchToBranchTraffic
$virtualWan = Get-AzVirtualWan -ResourceGroupName "testRg" -Name "testWan"
New-AzVirtualHub -ResourceGroupName "testRg" -Name "testHub" -Location "westcentralus" -AddressPrefix "10.0.0.0/16" -VirtualWan $virtualWan
$virtualHub = Get-AzVirtualHub -ResourceGroupName "testRg" -Name "testHub"
$fwIp = New-AzFirewallHubPublicIpAddress -Count 1
$hubIpAddresses = New-AzFirewallHubIpAddress -PublicIP $fwIp
New-AzFirewall -Name "testFirewall" -ResourceGroupName "testRg" -Location "westcentralus" -Sku AZFW_Hub -VirtualHubId $virtualHub.Id -HubIPAddress $hubIpAddresses
$firewall = Get-AzFirewall -Name "testFirewall" -ResourceGroupName "testRg"
$policy1 = New-AzRoutingPolicy -Name "PrivateTraffic" -Destination @("PrivateTraffic") -NextHop $firewall.Id
$policy2 = New-AzRoutingPolicy -Name "PublicTraffic" -Destination @("Internet") -NextHop $firewall.Id
New-AzRoutingIntent -ResourceGroupName "testRg" -VirtualHubName "testHub" -Name "testRoutingIntent" -RoutingPolicy @($policy1, $policy2)
Get-AzRoutingIntent -ResourceGroupName "testRg" -VirtualHubName "testHub" -Name "testRoutingIntent"
ProvisioningState : Succeeded
RoutingPolicies : {PrivateTraffic, PublicTraffic}
RoutingPoliciesText : [
{
"Name": "PrivateTraffic",
"DestinationType": "TrafficType",
"Destinations": [
"PrivateTraffic"
],
"NextHopType": "ResourceId",
"NextHop": "/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/azureFirewalls/testFirewall"
},
{
"Name": "PublicTraffic",
"DestinationType": "TrafficType",
"Destinations": [
"Internet"
],
"NextHopType": "ResourceId",
"NextHop": "/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/azureFirewalls/testFirewall"
}
]
Name : testRoutingIntent
Etag : W/"etag"
Id : /subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/routingIntent/testRoutingIntent
This command gets the routing intent of the virtual hub.
Example 2
$rgName = "testRg"
$virtualHubName = "testHub"
Get-AzRoutingIntent -Name $riName -VirtualHub $virtualHub
ProvisioningState : Succeeded
RoutingPolicies : {PrivateTraffic, PublicTraffic}
RoutingPoliciesText : [
{
"Name": "PrivateTraffic",
"DestinationType": "TrafficType",
"Destinations": [
"PrivateTraffic"
],
"NextHopType": "ResourceId",
"NextHop": "/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/azureFirewalls/testFirewall"
},
{
"Name": "PublicTraffic",
"DestinationType": "TrafficType",
"Destinations": [
"Internet"
],
"NextHopType": "ResourceId",
"NextHop": "/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/azureFirewalls/testFirewall"
}
]
Name : testRoutingIntent
Etag : W/"etag"
Id : /subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/routingIntent/testRoutingIntent
This command get the routing intent in the specified VirtualHub.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-HubName
The parent resource name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: VirtualHubName, ParentVirtualHubName, ParentResourceName
Parameter sets
ByVirtualHubName
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
The resource name.
Parameter properties
Type: String
Default value: None
Supports wildcards: True
DontShow: False
Aliases: ResourceName, RoutingIntentName
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ParentResourceId
The parent resource id.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: VirtualHubId, ParentVirtualHubId
Parameter sets
ByVirtualHubResourceId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ResourceGroupName
The resource group name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByVirtualHubName
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VirtualHub
The parent resource.
Parameter properties
Type: PSVirtualHub
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ParentObject, ParentVirtualHub
Parameter sets
ByVirtualHubObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs