Skip to content

Commit 52fd7a4

Browse files
Merge pull request #302592 from andreamichaelmsft/andrea-branch-2
[Azure Doc-a-thon] Updated VNet connect / peering tutorial
2 parents 958ac36 + 6fe3c1f commit 52fd7a4

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

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

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: In this tutorial, you learn how to connect virtual networks with vi
44
author: asudbring
55
ms.service: azure-virtual-network
66
ms.topic: tutorial
7-
ms.date: 11/14/2024
7+
ms.date: 07/11/2025
88
ms.author: allensu
99
ms.custom:
1010
- template-tutorial
@@ -20,17 +20,17 @@ ai-usage: ai-assisted
2020

2121
# Tutorial: Connect virtual networks with virtual network peering
2222

23-
You can connect virtual networks to each other with virtual network peering. These virtual networks can be in the same region or different regions (also known as global virtual network peering). Once virtual networks are peered, resources in both virtual networks can communicate with each other over a low-latency, high-bandwidth connection using Microsoft backbone network.
23+
You can connect virtual networks to each other with virtual network peering. These virtual networks can be in the same region or different regions (also known as global virtual network peering). Once virtual networks are peered, resources in both virtual networks can communicate with each other over a low-latency, high-bandwidth connection using the Microsoft backbone network.
2424

2525
:::image type="content" source="./media/tutorial-connect-virtual-networks-portal/resources-diagram.png" alt-text="Diagram of Azure resources created in tutorial." lightbox="./media/tutorial-connect-virtual-networks-portal/resources-diagram.png":::
2626

2727
In this tutorial, you learn how to:
2828

2929
> [!div class="checklist"]
3030
> * Create virtual networks
31-
> * Connect two virtual networks with a virtual network peering
31+
> * Connect two virtual networks with virtual network peering
3232
> * Deploy a virtual machine (VM) into each virtual network
33-
> * Communicate between VMs
33+
> * Communicate between virtual machines
3434
3535
## Prerequisites
3636

@@ -63,7 +63,7 @@ If you choose to install and use PowerShell locally, this article requires the A
6363
Repeat the previous steps to create a second virtual network with the following values:
6464

6565
>[!NOTE]
66-
>The second virtual network can be in the same region as the first virtual network or in a different region. You can skip the **Security** tab and the Bastion deployment for the second virtual network. After the network peer, you can connect to both virtual machines with the same Bastion deployment.
66+
>The second virtual network can be in the same region as the first virtual network or in a different region. You can skip the **Security** tab and the Bastion deployment for the second virtual network. After the virtual network peering is established, you can connect to both virtual machines with the same Bastion deployment.
6767
6868
| Setting | Value |
6969
| --- | --- |
@@ -75,7 +75,7 @@ Repeat the previous steps to create a second virtual network with the following
7575

7676
### [PowerShell](#tab/powershell)
7777

78-
Before creating a virtual network, you have to 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.
78+
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.
7979

8080
```azurepowershell-interactive
8181
$resourceGroup = @{
@@ -159,7 +159,7 @@ New-AzBastion @bastionParams -AsJob
159159
Create a second virtual network with [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork). The following example creates a virtual network named **vnet-2** with the address prefix **10.1.0.0/16**.
160160

161161
>[!NOTE]
162-
>The second virtual network can be in the same region as the first virtual network or in a different region. You don't need a Bastion deployment for the second virtual network. After the network peer, you can connect to both virtual machines with the same Bastion deployment.
162+
>The second virtual network can be in the same region as the first virtual network or in a different region. You don't need a Bastion deployment for the second virtual network. After the virtual network peering is established, you can connect to both virtual machines with the same Bastion deployment.
163163
164164
```azurepowershell-interactive
165165
$vnet2 = @{
@@ -190,7 +190,7 @@ $virtualNetwork2 | Set-AzVirtualNetwork
190190

191191
### [CLI](#tab/cli)
192192

193-
Before creating a virtual network, you have to 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.
193+
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.
194194

195195
```azurecli-interactive
196196
az group create \
@@ -250,7 +250,7 @@ az network bastion create \
250250
Create a second virtual network with [az network vnet create](/cli/azure/network/vnet#az-network-vnet-create). The following example creates a virtual network named **vnet-2** with the address prefix **10.1.0.0/16**.
251251

252252
>[!NOTE]
253-
>The second virtual network can be in the same region as the first virtual network or in a different region. You don't need a Bastion deployment for the second virtual network. After the network peer, you can connect to both virtual machines with the same Bastion deployment.
253+
>The second virtual network can be in the same region as the first virtual network or in a different region. You don't need a Bastion deployment for the second virtual network. After the virtual network peering is established, you can connect to both virtual machines with the same Bastion deployment.
254254
255255
```azurecli-interactive
256256
az network vnet create \
@@ -284,7 +284,7 @@ $peerConfig1 = @{
284284
Add-AzVirtualNetworkPeering @peerConfig1
285285
```
286286

287-
In the output returned after the previous command executes, you see that the **PeeringState** is **Initiated**. The peering remains in the **Initiated** state until you create the peering from **vnet-2** to **vnet-1**. Create a peering from **vnet-2** to **vnet-1**.
287+
In the output returned after the previous command executes, you see the **PeeringState** is **Initiated**. The peering remains in the **Initiated** state until you create the peering from **vnet-2** to **vnet-1**. Create a peering from **vnet-2** to **vnet-1**.
288288

289289
```azurepowershell-interactive
290290
$peerConfig2 = @{
@@ -295,7 +295,7 @@ $peerConfig2 = @{
295295
Add-AzVirtualNetworkPeering @peerConfig2
296296
```
297297

298-
In the output returned after the previous command executes, you see that the **PeeringState** is **Connected**. Azure also changed the peering state of the **vnet-1-to-vnet-2** peering to **Connected**. Confirm that the peering state for the **vnet-1-to-vnet-2** peering changed to **Connected** with [Get-AzVirtualNetworkPeering](/powershell/module/az.network/get-azvirtualnetworkpeering).
298+
In the output returned after the previous command executes, you see the **PeeringState** is **Connected**. Azure also changed the peering state of the **vnet-1-to-vnet-2** peering to **Connected**. Confirm the peering state for the **vnet-1-to-vnet-2** peering changed to **Connected** with [Get-AzVirtualNetworkPeering](/powershell/module/az.network/get-azvirtualnetworkpeering).
299299

300300
```azurepowershell-interactive
301301
$peeringState = @{
@@ -311,7 +311,7 @@ Resources in one virtual network can't communicate with resources in the other v
311311

312312
## Peer virtual networks
313313

314-
Peerings are established between virtual network IDs. Obtain the ID of each virtual network with [az network vnet show](/cli/azure/network/vnet#az-network-vnet-show) and store the ID in a variable.
314+
Peerings are established between virtual network IDs. Obtain the ID of each virtual network with [az network vnet show](/cli/azure/network/vnet#az-network-vnet-show) and store the IDs in their respective variables.
315315

316316
```azurecli-interactive
317317
# Get the id for vnet-1.
@@ -339,7 +339,7 @@ az network vnet peering create \
339339
--allow-vnet-access
340340
```
341341

342-
In the output returned after the previous command executes, you see that the **peeringState** is **Initiated**. The peering remains in the **Initiated** state until you create the peering from **vnet-2** to **vnet-1**. Create a peering from **vnet-2** to **vnet-1**.
342+
In the output returned after the previous command executes, you see the **peeringState** is **Initiated**. The peering remains in the **Initiated** state until you create the peering from **vnet-2** to **vnet-1**. Create a peering from **vnet-2** to **vnet-1**.
343343

344344
```azurecli-interactive
345345
az network vnet peering create \
@@ -350,7 +350,7 @@ az network vnet peering create \
350350
--allow-vnet-access
351351
```
352352

353-
In the output returned after the previous command executes, you see that the **peeringState** is **Connected**. Azure also changed the peering state of the **vnet-1-to-vnet-2** peering to **Connected**. Confirm that the peering state for the **vnet-1-to-vnet-2** peering changed to **Connected** with [az network vnet peering show](/cli/azure/network/vnet/peering#az-network-vnet-show).
353+
In the output returned after the previous command executes, you see the **peeringState** is **Connected**. Azure also changed the peering state of the **vnet-1-to-vnet-2** peering to **Connected**. Confirm the peering state for the **vnet-1-to-vnet-2** peering changed to **Connected** with [az network vnet peering show](/cli/azure/network/vnet/peering#az-network-vnet-show).
354354

355355
```azurecli-interactive
356356
az network vnet peering show \
@@ -366,7 +366,7 @@ Resources in one virtual network can't communicate with resources in the other v
366366

367367
## Create virtual machines
368368

369-
Test the communication between the virtual machines by creating a virtual machine in each virtual network. The virtual machines can communicate with each other over the virtual network peering.
369+
Test the communication between the virtual machines by creating a virtual machine in each virtual network. The virtual machines can communicate with each other over the virtual network peering you just created.
370370

371371
### [Portal](#tab/portal)
372372

@@ -387,13 +387,13 @@ Repeat the previous steps to create a second virtual machine in the second virtu
387387

388388
### Create the first virtual machine
389389

390-
Create a VM with [New-AzVM](/powershell/module/az.compute/new-azvm). The following example creates a VM named **vm-1** in the **vnet-1** virtual network. When prompted, enter the username and password for the virtual machine.
390+
Create a virtual machine with [New-AzVM](/powershell/module/az.compute/new-azvm). The following example creates a virtual machine named **vm-1** in the **vnet-1** virtual network. When prompted, enter the username and password for the virtual machine.
391391

392392
```azurepowershell-interactive
393393
# Create a credential object
394394
$cred = Get-Credential
395395
396-
# Define the VM parameters
396+
# Define the virtual machine parameters
397397
$vmParams = @{
398398
ResourceGroupName = "test-rg"
399399
Location = "EastUS2"
@@ -406,17 +406,17 @@ $vmParams = @{
406406
PublicIpAddressName = $null # No public IP address
407407
}
408408
409-
# Create the VM
409+
# Create the virtual machine
410410
New-AzVM @vmParams
411411
```
412412

413-
### Create the second VM
413+
### Create the second virtual machine
414414

415415
```azurepowershell-interactive
416416
# Create a credential object
417417
$cred = Get-Credential
418418
419-
# Define the VM parameters
419+
# Define the virtual machine parameters
420420
$vmParams = @{
421421
ResourceGroupName = "test-rg"
422422
Location = "EastUS2"
@@ -429,15 +429,15 @@ $vmParams = @{
429429
PublicIpAddressName = $null # No public IP address
430430
}
431431
432-
# Create the VM
432+
# Create the virtual machine
433433
New-AzVM @vmParams
434434
```
435435

436436
### [CLI](#tab/cli)
437437

438-
### Create the first VM
438+
### Create the first virtual machine
439439

440-
Create a VM with [az vm create](/cli/azure/vm#az-vm-create). The following example creates a VM named **vm-1** in the **vnet-1** virtual network. If SSH keys don't already exist in a default key location, the command creates them. The `--no-wait` option creates the VM in the background, so you can continue to the next step.
440+
Create a virtual machine with [az vm create](/cli/azure/vm#az-vm-create). The following example creates a virtual machine named **vm-1** in the **vnet-1** virtual network. If SSH keys don't already exist in a default key location, the command creates them. The `--no-wait` option creates the virtual machine in the background, so you can continue to the next step.
441441

442442
```azurecli-interactive
443443
az vm create \
@@ -451,9 +451,9 @@ az vm create \
451451
--no-wait
452452
```
453453

454-
### Create the second VM
454+
### Create the second virtual machine
455455

456-
Create a VM in the **vnet-2** virtual network.
456+
Create a virtual machine in the **vnet-2** virtual network.
457457

458458
```azurecli-interactive
459459
az vm create \
@@ -466,15 +466,15 @@ az vm create \
466466
--authentication-type password
467467
```
468468

469-
The VM takes a few minutes to create.
469+
The virtual machine takes a few minutes to create.
470470

471471
---
472472

473473
Wait for the virtual machines to be created before continuing with the next steps.
474474

475475
## Connect to a virtual machine
476476

477-
Use `ping` to test the communication between the virtual machines. Sign-in to the Azure portal to complete the following steps.
477+
Use `ping` to test the communication between the virtual machines. Sign in to the Azure portal to complete the following steps.
478478

479479
1. In the portal, search for and select **Virtual machines**.
480480

@@ -486,9 +486,9 @@ Use `ping` to test the communication between the virtual machines. Sign-in to th
486486

487487
1. Select **Use Bastion**.
488488

489-
1. Enter the username and password you created when you created the VM, and then select **Connect**.
489+
1. Enter the username and password you created when you created the virtual machine, then select **Connect**.
490490

491-
## Communicate between VMs
491+
## Communicate between virtual machines
492492

493493
1. At the bash prompt for **vm-1**, enter `ping -c 4 10.1.0.4`.
494494

@@ -562,7 +562,7 @@ In this tutorial, you:
562562

563563
* Tested the communication between two virtual machines over the virtual network peering with `ping`.
564564

565-
To learn more about a virtual network peering:
565+
To learn more about virtual network peering:
566566

567567
> [!div class="nextstepaction"]
568-
> [Virtual network peering](virtual-network-peering-overview.md)
568+
> [Virtual network peering overview](virtual-network-peering-overview.md)

0 commit comments

Comments
 (0)