Get-AzRoutingIntent
Hämtar en routnings avsiktsresurs som är associerad med en VirtualHub.
Syntax
Get-AzRoutingIntent
-ResourceGroupName <String>
-HubName <String>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRoutingIntent
-VirtualHub <PSVirtualHub>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRoutingIntent
-ParentResourceId <String>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Hämtar den angivna routnings avsikten som är associerad med den angivna virtuella hubben.
Exempel
Exempel 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
Det här kommandot hämtar routnings avsikten för den virtuella hubben.
Exempel 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
Det här kommandot hämtar routnings avsikten i den angivna VirtualHub.
Parametrar
-DefaultProfile
Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.
Typ: | IAzureContextContainer |
Alias: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-HubName
Det överordnade resursnamnet.
Typ: | String |
Alias: | VirtualHubName, ParentVirtualHubName, ParentResourceName |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-Name
Resursnamnet.
Typ: | String |
Alias: | ResourceName, RoutingIntentName |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | True |
-ParentResourceId
Det överordnade resurs-ID:t.
Typ: | String |
Alias: | VirtualHubId, ParentVirtualHubId |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | True |
Godkänn jokertecken: | False |
-ResourceGroupName
Resursgruppens namn.
Typ: | String |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-VirtualHub
Den överordnade resursen.
Typ: | PSVirtualHub |
Alias: | ParentObject, ParentVirtualHub |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | True |
Godkänn jokertecken: | False |