New-AzRoutingConfiguration

Creates a RoutingConfiguration object.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

New-AzRoutingConfiguration
   -AssociatedRouteTable <String>
   -Label <String[]>
   -Id <String[]>
   [-StaticRoute <PSStaticRoute[]>]
    [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Creates a RoutingConfiguration object.

Examples

Example 1

PS C:\> $rgName = "testRg"
PS C:\> $virtualHubName = "testHub"
PS C:\> $rt1 = Get-AzVHubRouteTable -ResourceGroupName $rgName -VirtualHubName $virtualHubName -Name "defaultRouteTable"
PS C:\> $rt2 = Get-AzVHubRouteTable -ResourceGroupName $rgName -VirtualHubName $virtualHubName -Name "noneRouteTable"
PS C:\> $route1 = New-AzStaticRoute -Name "route1" -AddressPrefix @("10.20.0.0/16", "10.30.0.0/16")-NextHopIpAddress "10.90.0.5"
PS C:\> New-AzRoutingConfiguration -AssociatedRouteTable $rt1.Id -Label @("testLabel") -Id @($rt2.Id) -StaticRoute @($route1)

AssociatedRouteTable  : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/hubRouteTables/defaultRouteTable"
PropagatedRouteTables : {
                          "Labels": [
                            "testLabel"
                          ],
                          "Ids": [
                            {
                              "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/hubRouteTables/noneRouteTable"
                            }
                          ]
                        }
VnetRoutes            : {
                          "StaticRoutes": [
                            {
                              "Name": "route1",
                              "AddressPrefixes": [
                                "10.20.0.0/16",
                                "10.30.0.0/16"
                              ],
                              "NextHopIpAddress": "10.90.0.5"
                            }
                          ]
                        }

The above command will create a RoutingConfiguration object which can then be added to a connection resource. Static routes are only allowed with a HubVirtualNetworkConnection object.

Parameters

-AssociatedRouteTable

The hub route table associated with this routing configuration.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

The list of resource ids of all the hub route tables to advertise the routes to for the PropagatedRouteTables property.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Label

The list of labels for the PropagatedRouteTables property.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StaticRoute

List of routes that control routing from VirtualHub into a virtual network connection.

Type:PSStaticRoute[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

PSStaticRoute

Outputs

PSRoutingConfiguration