Partilhar via


Get-AzRoutingIntent

Recupera um recurso de intenção de roteamento associado a um VirtualHub.

Sintaxe

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

Obtém a intenção de roteamento especificada associada ao hub virtual especificado.

Exemplos

Exemplo 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

Este comando obtém a intenção de roteamento do hub virtual.

Exemplo 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

Este comando obtém a intenção de roteamento no VirtualHub especificado.

Parâmetros

-DefaultProfile

As credenciais, a conta, o locatário e a assinatura usados para comunicação com o Azure.

Tipo:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Necessário:False
Aceitar entrada de pipeline:False
Aceitar carateres universais:False

-HubName

O nome do recurso pai.

Tipo:String
Aliases:VirtualHubName, ParentVirtualHubName, ParentResourceName
Position:Named
Default value:None
Necessário:True
Aceitar entrada de pipeline:False
Aceitar carateres universais:False

-Name

O nome do recurso.

Tipo:String
Aliases:ResourceName, RoutingIntentName
Position:Named
Default value:None
Necessário:False
Aceitar entrada de pipeline:False
Aceitar carateres universais:True

-ParentResourceId

A id do recurso pai.

Tipo:String
Aliases:VirtualHubId, ParentVirtualHubId
Position:Named
Default value:None
Necessário:True
Aceitar entrada de pipeline:True
Aceitar carateres universais:False

-ResourceGroupName

O nome do grupo de recursos.

Tipo:String
Position:Named
Default value:None
Necessário:True
Aceitar entrada de pipeline:False
Aceitar carateres universais:False

-VirtualHub

O recurso pai.

Tipo:PSVirtualHub
Aliases:ParentObject, ParentVirtualHub
Position:Named
Default value:None
Necessário:True
Aceitar entrada de pipeline:True
Aceitar carateres universais:False

Entradas

PSVirtualHub

String

Saídas

PSRoutingIntent