Skip to content

Commit 5491227

Browse files
committed
docs: Restructure resource group and virtual network into separate tabbed sections
- Create separate '## Create a resource group' section with Portal/PowerShell/CLI tabs - Create separate '## Create a virtual network' section with Portal/PowerShell/CLI tabs - Remove duplicate resource group creation from PowerShell and CLI sections - Improve document organization and clarity
1 parent 045220a commit 5491227

1 file changed

Lines changed: 28 additions & 20 deletions

File tree

articles/virtual-network/tutorial-connect-virtual-networks.md

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ If you choose to install and use PowerShell locally, this article requires the A
5656

5757
---
5858

59-
### [Portal](#tab/portal)
60-
6159
## Create a resource group
6260

61+
### [Portal](#tab/portal)
62+
6363
1. Sign in to the [Azure portal](https://portal.azure.com).
6464

6565
1. In the search box at the top of the portal, enter **Resource group**. Select **Resource groups** in the search results.
@@ -78,8 +78,34 @@ If you choose to install and use PowerShell locally, this article requires the A
7878

7979
1. Select **Create**.
8080

81+
### [PowerShell](#tab/powershell)
82+
83+
Create a resource group with [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup). The following example creates a resource group named **test-rg** in the **eastus2** location.
84+
85+
```azurepowershell-interactive
86+
$resourceGroup = @{
87+
Name = "test-rg"
88+
Location = "EastUS2"
89+
}
90+
New-AzResourceGroup @resourceGroup
91+
```
92+
93+
### [CLI](#tab/cli)
94+
95+
Create a resource group with [az group create](/cli/azure/group). The following example creates a resource group named **test-rg** in the **eastus2** location.
96+
97+
```azurecli-interactive
98+
az group create \
99+
--name test-rg \
100+
--location eastus2
101+
```
102+
103+
---
104+
81105
## Create a virtual network
82106

107+
### [Portal](#tab/portal)
108+
83109
1. In the search box at the top of the portal, enter **Virtual network**. Select **Virtual networks** in the search results.
84110

85111
1. Select **+ Create**.
@@ -162,16 +188,6 @@ Repeat the previous steps to create a second virtual network with the following
162188

163189
### [PowerShell](#tab/powershell)
164190

165-
Before creating a virtual network, you must create a resource group for the virtual network and all other resources created in this article. Create a resource group with [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup). The following example creates a resource group named **test-rg** in the **eastus** location.
166-
167-
```azurepowershell-interactive
168-
$resourceGroup = @{
169-
Name = "test-rg"
170-
Location = "EastUS2"
171-
}
172-
New-AzResourceGroup @resourceGroup
173-
```
174-
175191
Create a virtual network with [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork). The following example creates a virtual network named **vnet-1** with the address prefix **10.0.0.0/16**.
176192

177193
```azurepowershell-interactive
@@ -278,14 +294,6 @@ $virtualNetwork2 | Set-AzVirtualNetwork
278294

279295
### [CLI](#tab/cli)
280296

281-
Before creating a virtual network, you must create a resource group for the virtual network and all other resources created in this article. Create a resource group with [az group create](/cli/azure/group). The following example creates a resource group named **test-rg** in the **eastus** location.
282-
283-
```azurecli-interactive
284-
az group create \
285-
--name test-rg \
286-
--location eastus2
287-
```
288-
289297
Create a virtual network with [az network vnet create](/cli/azure/network/vnet#az-network-vnet-create). The following example creates a virtual network named **vnet-1** with the address prefix **10.0.0.0/16**.
290298

291299
```azurecli-interactive

0 commit comments

Comments
 (0)