Skip to content

Commit 14a5ca5

Browse files
committed
docs: Update VNet peering tutorial to use SSH auth and Basic Bastion
1 parent b4bc9e6 commit 14a5ca5

1 file changed

Lines changed: 148 additions & 7 deletions

File tree

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

Lines changed: 148 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,99 @@ If you choose to install and use PowerShell locally, this article requires the A
5858

5959
### [Portal](#tab/portal)
6060

61-
[!INCLUDE [virtual-network-create-with-bastion.md](~/reusable-content/ce-skilling/azure/includes/virtual-network-create-with-bastion.md)]
61+
## Create a resource group
62+
63+
1. Sign in to the [Azure portal](https://portal.azure.com).
64+
65+
1. In the search box at the top of the portal, enter **Resource group**. Select **Resource groups** in the search results.
66+
67+
1. Select **+ Create**.
68+
69+
1. In the **Basics** tab of **Create a resource group**, enter or select the following information:
70+
71+
| Setting | Value |
72+
| ------- | ----- |
73+
| Subscription | Select your subscription. |
74+
| Resource group | Enter **test-rg**. |
75+
| Region | Select **East US 2**. |
76+
77+
1. Select **Review + create**.
78+
79+
1. Select **Create**.
80+
81+
## Create a virtual network
82+
83+
1. In the search box at the top of the portal, enter **Virtual network**. Select **Virtual networks** in the search results.
84+
85+
1. Select **+ Create**.
86+
87+
1. On the **Basics** tab of **Create virtual network**, enter or select the following information:
88+
89+
| Setting | Value |
90+
|---|---|
91+
| **Project details** | |
92+
| Subscription | Select your subscription. |
93+
| Resource group | Select **test-rg**. |
94+
| **Instance details** | |
95+
| Name | Enter **vnet-1**. |
96+
| Region | Select **East US 2**. |
97+
98+
1. Select **Next** to proceed to the **Security** tab.
99+
100+
1. Select **Next** to proceed to the **IP Addresses** tab.
101+
102+
1. In the address space box in **Subnets**, select the **default** subnet.
103+
104+
1. In **Edit subnet**, enter or select the following information:
105+
106+
| Setting | Value |
107+
|---|---|
108+
| **Subnet details** | |
109+
| Subnet template | Leave the default **Default**. |
110+
| Name | Enter **subnet-1**. |
111+
| Starting address | Leave the default of **10.0.0.0**. |
112+
| Subnet size | Leave the default of **/24 (256 addresses)**. |
113+
114+
1. Select **Save**.
115+
116+
1. Select **Review + create** at the bottom of the screen, and when validation passes, select **Create**.
117+
118+
## Deploy Azure Bastion
119+
120+
Azure Bastion uses your browser to connect to VMs in your virtual network over secure shell (SSH) or remote desktop protocol (RDP) by using their private IP addresses. The VMs don't need public IP addresses, client software, or special configuration. For more information about Azure Bastion, see [Azure Bastion](/azure/bastion/bastion-overview).
121+
122+
>[!NOTE]
123+
>[!INCLUDE [Pricing](~/reusable-content/ce-skilling/azure/includes/bastion-pricing.md)]
124+
125+
1. In the search box at the top of the portal, enter **Bastion**. Select **Bastions** in the search results.
126+
127+
1. Select **+ Create**.
128+
129+
1. In the **Basics** tab of **Create a Bastion**, enter or select the following information:
130+
131+
| Setting | Value |
132+
|---|---|
133+
| **Project details** | |
134+
| Subscription | Select your subscription. |
135+
| Resource group | Select **test-rg**. |
136+
| **Instance details** | |
137+
| Name | Enter **bastion**. |
138+
| Region | Select **East US 2**. |
139+
| Tier | Select **Developer**. |
140+
| **Configure virtual networks** | |
141+
| Virtual network | Select **vnet-1**. |
142+
| Subnet | The **AzureBastionSubnet** is created automatically with an address space of **/26** or larger. |
143+
144+
1. Select **Review + create**.
145+
146+
1. Select **Create**.
147+
148+
## Create a second virtual network
62149

63150
Repeat the previous steps to create a second virtual network with the following values:
64151

65152
>[!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 virtual network peering is established, you can connect to both virtual machines with the same Bastion deployment.
153+
>The second virtual network can be in the same region as the first virtual network or in a different region. You can skip 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.
67154
68155
| Setting | Value |
69156
| --- | --- |
@@ -150,6 +237,7 @@ $bastionParams = @{
150237
PublicIpAddressName = "public-ip-bastion"
151238
PublicIpAddressRgName = "test-rg"
152239
VirtualNetworkRgName = "test-rg"
240+
Sku = "Basic"
153241
}
154242
New-AzBastion @bastionParams -AsJob
155243
```
@@ -242,6 +330,7 @@ az network bastion create \
242330
--vnet-name vnet-1 \
243331
--public-ip-address public-ip-bastion \
244332
--location eastus2 \
333+
--sku Basic \
245334
--no-wait
246335
```
247336

@@ -370,14 +459,60 @@ Test the communication between the virtual machines by creating a virtual machin
370459

371460
### [Portal](#tab/portal)
372461

373-
[!INCLUDE [create-test-virtual-machine-linux.md](~/reusable-content/ce-skilling/azure/includes/create-test-virtual-machine-linux.md)]
462+
## Create virtual machines
463+
464+
1. In the search box at the top of the portal, enter **Virtual machine**. Select **Virtual machines** in the search results.
465+
466+
1. Select **+ Create** then **Azure virtual machine**.
467+
468+
1. In **Create a virtual machine** enter or select the following information in the **Basics** tab:
469+
470+
| Setting | Value |
471+
| ------- | ----- |
472+
| **Project details** | |
473+
| Subscription | Select your subscription. |
474+
| Resource group | Select **test-rg**. |
475+
| **Instance details** | |
476+
| Virtual machine name | Enter **vm-1**. |
477+
| Region | Select **(US) East US 2**. |
478+
| Availability options | Select **No infrastructure redundancy required**. |
479+
| Security type | Select **Standard**. |
480+
| Image | Select **Ubuntu Server 24.04 LTS - x64 Gen2**. |
481+
| VM architecture | Leave the default of **x64**. |
482+
| Size | Select a size. |
483+
| **Administrator account** | |
484+
| Authentication type | Select **SSH public key**. |
485+
| Username | Enter a username. |
486+
| SSH public key source | Select **Generate new key pair**. |
487+
| Key pair name | Enter **vm-1-key**. |
488+
| **Inbound port rules** | |
489+
| Public inbound ports | Select **None**. |
490+
491+
1. Select **Next: Disks** then **Next: Networking**.
492+
493+
1. In the Networking tab, enter or select the following information:
494+
495+
| Setting | Value |
496+
| ------- | ----- |
497+
| **Network interface** | |
498+
| Virtual network | Select **vnet-1**. |
499+
| Subnet | Select **subnet-1 (10.0.0.0/24)**. |
500+
| Public IP | Select **None**. |
501+
| NIC network security group | Select **Advanced**. |
502+
| Configure network security group | Select **Create new**. </br> In **Name** enter **nsg-1**. </br> Select **OK**. |
503+
504+
1. Leave the rest of the options at the defaults and select **Review + create**.
505+
506+
1. Select **Create**.
374507

375508
Repeat the previous steps to create a second virtual machine in the second virtual network with the following values:
376509

377510
| Setting | Value |
378511
| --- | --- |
379512
| Virtual machine name | **vm-2** |
380513
| Region | **East US 2** or same region as **vnet-2**. |
514+
| SSH public key source | **Generate new key pair**. |
515+
| Key pair name | **vm-2-key**. |
381516
| Virtual network | Select **vnet-2**. |
382517
| Subnet | Select **subnet-1 (10.1.0.0/24)**. |
383518
| Public IP | **None** |
@@ -398,12 +533,14 @@ $vmParams = @{
398533
ResourceGroupName = "test-rg"
399534
Location = "EastUS2"
400535
Name = "vm-1"
401-
ImageName = "Canonical:ubuntu-24_04-lts:server-gen1:latest"
536+
Image = "Ubuntu2204"
402537
Size = "Standard_DS1_v2"
403538
Credential = $cred
404539
VirtualNetworkName = "vnet-1"
405540
SubnetName = "subnet-1"
406-
PublicIpAddressName = $null # No public IP address
541+
PublicIpAddressName = "" # No public IP address
542+
SshKeyName = "vm-1-ssh-key"
543+
GenerateSshKey = $true
407544
}
408545
409546
# Create the virtual machine
@@ -421,12 +558,14 @@ $vmParams = @{
421558
ResourceGroupName = "test-rg"
422559
Location = "EastUS2"
423560
Name = "vm-2"
424-
ImageName = "Canonical:ubuntu-24_04-lts:server-gen1:latest"
561+
Image = "Ubuntu2204"
425562
Size = "Standard_DS1_v2"
426563
Credential = $cred
427564
VirtualNetworkName = "vnet-2"
428565
SubnetName = "subnet-1"
429-
PublicIpAddressName = $null # No public IP address
566+
PublicIpAddressName = "" # No public IP address
567+
SshKeyName = "vm-2-ssh-key"
568+
GenerateSshKey = $true
430569
}
431570
432571
# Create the virtual machine
@@ -446,6 +585,7 @@ az vm create \
446585
--image Ubuntu2204 \
447586
--vnet-name vnet-1 \
448587
--subnet subnet-1 \
588+
--public-ip-address "" \
449589
--admin-username azureuser \
450590
--generate-ssh-keys \
451591
--no-wait
@@ -462,6 +602,7 @@ az vm create \
462602
--image Ubuntu2204 \
463603
--vnet-name vnet-2 \
464604
--subnet subnet-1 \
605+
--public-ip-address "" \
465606
--admin-username azureuser \
466607
--generate-ssh-keys
467608
```

0 commit comments

Comments
 (0)