New-AzRouteTable
Creates a route table.
New-AzRouteTable
-ResourceGroupName <String>
-Name <String>
[-DisableBgpRoutePropagation]
-Location <String>
[-Tag <Hashtable>]
[-Route <PSRoute[]>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The New-AzRouteTable cmdlet creates an Azure route table.
$Route = New-AzRouteConfig -Name "Route07" -AddressPrefix 10.1.0.0/16 -NextHopType "VnetLocal"
New-AzRouteTable -Name "RouteTable01" -ResourceGroupName "ResourceGroup11" -Location "EASTUS" -Route $Route
Name : routetable01
ResourceGroupName : ResourceGroup11
Location : eastus
Id : /subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/ResourceGroup11/providers/Microsoft.Networ
k/routeTables/myroutetable
Etag : W/"db5f4e12-3f34-465b-92dd-0ab3bf6fc274"
ProvisioningState : Succeeded
Tags :
Routes : [
{
"Name": "route07",
"Etag": "W/\"db5f4e12-3f34-465b-92dd-0ab3bf6fc274\"",
"Id": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourceGroups/ResourceGroup11/providers/Micro
soft.Network/routeTables/routetable01/routes/route07",
"AddressPrefix": "10.1.0.0/16",
"NextHopType": "VnetLocal",
"NextHopIpAddress": null,
"ProvisioningState": "Succeeded"
}
]
Subnets : []
The first command creates a route named Route07 by using the New-AzRouteConfig cmdlet, and then stores it in the $Route variable. This route forwards packets to the local virtual network. The second command creates a route table named RouteTable01, and adds the route stored in $Route to the new table. The command specifies the resource group to which the table belongs and the location for the table.
Run cmdlet in the background
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Disable BGP Route auto propagation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that this cmdlet creates a route table even if a route table that has the same name already exists.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the Azure region in which this cmdlet creates a route table. For more information, see Azure Regions.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies a name for the route table.
Type: | String |
Aliases: | ResourceName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the name of the resource group in which this cmdlet creates a route table.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies an array of Route objects to associate with the route table.
Type: | PSRoute[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Key-value pairs in the form of a hash table. For example: @{key0="value0";key1=$null;key2="value2"}
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
PSRoute[]
Azure PowerShell feedback
Azure PowerShell is an open source project. Select a link to provide feedback: