Skip to content

Commit 6c8b563

Browse files
committed
added CLI content
1 parent b5ad7e3 commit 6c8b563

File tree

1 file changed

+32
-17
lines changed

1 file changed

+32
-17
lines changed

articles/virtual-network/tutorial-create-route-table-portal.md

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ ms.service: azure-virtual-network
77
ms.date: 10/31/2024
88
ms.author: allensu
99
ms.topic: tutorial
10-
ms.custom: template-tutorial
10+
ms.custom:
11+
- template-tutorial
12+
- devx-track-azurecli
13+
- devx-track-azurepowershell
14+
content_well_notification:
15+
- AI-contribution
16+
ai-usage: ai-assisted
1117
# Customer intent: I want to route traffic from one subnet, to a different subnet, through a network virtual appliance.
1218
---
1319

@@ -195,6 +201,15 @@ New-AzBastion @bastionParams -AsJob
195201

196202
### [CLI](#tab/cli)
197203

204+
Create a resource group with [az group create](/cli/azure/group) for all resources created in this article.
205+
206+
```azurecli-interactive
207+
# Create a resource group.
208+
az group create \
209+
--name test-rg \
210+
--location eastus2
211+
```
212+
198213
---
199214

200215
## Create an NVA virtual machine
@@ -586,9 +601,9 @@ Create a route table with [New-AzRouteTable](/powershell/module/az.network/new-a
586601

587602
```azurepowershell-interactive
588603
$routeTableParams = @{
589-
Name = 'route-table-public'
590-
ResourceGroupName = 'test-rg'
591-
Location = 'eastus2'
604+
Name = 'route-table-public'
605+
ResourceGroupName = 'test-rg'
606+
Location = 'eastus2'
592607
}
593608
$routeTablePublic = New-AzRouteTable @routeTableParams
594609
```
@@ -597,15 +612,15 @@ Create a route by retrieving the route table object with [Get-AzRouteTable](/pow
597612

598613
```azurepowershell-interactive
599614
$routeTableParams = @{
600-
ResourceGroupName = "test-rg"
601-
Name = "route-table-public"
615+
ResourceGroupName = "test-rg"
616+
Name = "route-table-public"
602617
}
603618
604619
$routeConfigParams = @{
605-
Name = "to-private-subnet"
606-
AddressPrefix = "10.0.2.0/24"
607-
NextHopType = "VirtualAppliance"
608-
NextHopIpAddress = "10.0.3.4"
620+
Name = "to-private-subnet"
621+
AddressPrefix = "10.0.2.0/24"
622+
NextHopType = "VirtualAppliance"
623+
NextHopIpAddress = "10.0.3.4"
609624
}
610625
611626
$routeTable = Get-AzRouteTable @routeTableParams
@@ -616,16 +631,16 @@ Associate the route table with the **subnet-1** subnet with [Set-AzVirtualNetwor
616631

617632
```azurepowershell-interactive
618633
$vnetParams = @{
619-
Name = 'vnet-1'
620-
ResourceGroupName = 'test-rg'
634+
Name = 'vnet-1'
635+
ResourceGroupName = 'test-rg'
621636
}
622637
$virtualNetwork = Get-AzVirtualNetwork @vnetParams
623638
624639
$subnetParams = @{
625-
VirtualNetwork = $virtualNetwork
626-
Name = 'subnet-1'
627-
AddressPrefix = '10.0.0.0/24'
628-
RouteTable = $routeTablePublic
640+
VirtualNetwork = $virtualNetwork
641+
Name = 'subnet-1'
642+
AddressPrefix = '10.0.0.0/24'
643+
RouteTable = $routeTablePublic
629644
}
630645
Set-AzVirtualNetworkSubnetConfig @subnetParams | Set-AzVirtualNetwork
631646
```
@@ -718,7 +733,7 @@ When no longer needed, use [Remove-AzResourcegroup](/powershell/module/az.resour
718733
719734
```azurepowershell-interactive
720735
$rgParams = @{
721-
Name = "test-rg"
736+
Name = "test-rg"
722737
}
723738
Remove-AzResourceGroup @rgParams -Force
724739
```

0 commit comments

Comments
 (0)