Skip to content

Commit e725b67

Browse files
committed
docs: Restructure Azure Bastion and second virtual network into separate tabbed sections
- Create separate '## Deploy Azure Bastion' section with Portal/PowerShell/CLI tabs - Create separate '## Create a second virtual network' section with Portal/PowerShell/CLI tabs - Remove Bastion and second vnet code from 'Create a virtual network' section - Improve document organization with better separation of concerns
1 parent 5491227 commit e725b67

1 file changed

Lines changed: 237 additions & 56 deletions

File tree

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

Lines changed: 237 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -141,51 +141,6 @@ az group create \
141141

142142
1. Select **Review + create** at the bottom of the screen, and when validation passes, select **Create**.
143143

144-
## Deploy Azure Bastion
145-
146-
Azure Bastion uses your browser to connect to virtual machines (VMs) in your virtual network over secure shell (SSH) or remote desktop protocol (RDP) by using their private IP addresses. The virtual machines don't need public IP addresses, client software, or special configuration. For more information about Azure Bastion, see [Azure Bastion](/azure/bastion/bastion-overview).
147-
148-
>[!NOTE]
149-
>[!INCLUDE [Pricing](~/reusable-content/ce-skilling/azure/includes/bastion-pricing.md)]
150-
151-
1. In the search box at the top of the portal, enter **Bastion**. Select **Bastions** in the search results.
152-
153-
1. Select **+ Create**.
154-
155-
1. In the **Basics** tab of **Create a Bastion**, enter, or select the following information:
156-
157-
| Setting | Value |
158-
|---|---|
159-
| **Project details** | |
160-
| Subscription | Select your subscription. |
161-
| Resource group | Select **test-rg**. |
162-
| **Instance details** | |
163-
| Name | Enter **bastion**. |
164-
| Region | Select **East US 2**. |
165-
| Tier | Select **Developer**. |
166-
| **Configure virtual networks** | |
167-
| Virtual network | Select **vnet-1**. |
168-
| Subnet | The **AzureBastionSubnet** is created automatically with an address space of **/26** or larger. |
169-
170-
1. Select **Review + create**.
171-
172-
1. Select **Create**.
173-
174-
## Create a second virtual network
175-
176-
Repeat the previous steps to create a second virtual network with the following values:
177-
178-
>[!NOTE]
179-
>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.
180-
181-
| Setting | Value |
182-
| --- | --- |
183-
| Name | **vnet-2** |
184-
| Address space | **10.1.0.0/16** |
185-
| Resource group | **test-rg** |
186-
| Subnet name | **subnet-1** |
187-
| Subnet address range | **10.1.0.0/24** |
188-
189144
### [PowerShell](#tab/powershell)
190145

191146
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**.
@@ -228,7 +183,65 @@ Write the subnet configuration to the virtual network with [Set-AzVirtualNetwork
228183
$virtualNetwork1 | Set-AzVirtualNetwork
229184
```
230185

231-
### Create Azure Bastion
186+
### [CLI](#tab/cli)
187+
188+
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**.
189+
190+
```azurecli-interactive
191+
az network vnet create \
192+
--name vnet-1 \
193+
--resource-group test-rg \
194+
--address-prefixes 10.0.0.0/16 \
195+
--subnet-name subnet-1 \
196+
--subnet-prefix 10.0.0.0/24
197+
```
198+
199+
Create the Bastion subnet with [az network vnet subnet create](/cli/azure/network/vnet/subnet).
200+
201+
```azurecli-interactive
202+
# Create a bastion subnet.
203+
az network vnet subnet create \
204+
--vnet-name vnet-1 \
205+
--resource-group test-rg \
206+
--name AzureBastionSubnet \
207+
--address-prefix 10.0.1.0/24
208+
```
209+
210+
---
211+
212+
## Deploy Azure Bastion
213+
214+
### [Portal](#tab/portal)
215+
216+
Azure Bastion uses your browser to connect to virtual machines (VMs) in your virtual network over secure shell (SSH) or remote desktop protocol (RDP) by using their private IP addresses. The virtual machines don't need public IP addresses, client software, or special configuration. For more information about Azure Bastion, see [Azure Bastion](/azure/bastion/bastion-overview).
217+
218+
>[!NOTE]
219+
>[!INCLUDE [Pricing](~/reusable-content/ce-skilling/azure/includes/bastion-pricing.md)]
220+
221+
1. In the search box at the top of the portal, enter **Bastion**. Select **Bastions** in the search results.
222+
223+
1. Select **+ Create**.
224+
225+
1. In the **Basics** tab of **Create a Bastion**, enter, or select the following information:
226+
227+
| Setting | Value |
228+
|---|---|
229+
| **Project details** | |
230+
| Subscription | Select your subscription. |
231+
| Resource group | Select **test-rg**. |
232+
| **Instance details** | |
233+
| Name | Enter **bastion**. |
234+
| Region | Select **East US 2**. |
235+
| Tier | Select **Developer**. |
236+
| **Configure virtual networks** | |
237+
| Virtual network | Select **vnet-1**. |
238+
| Subnet | The **AzureBastionSubnet** is created automatically with an address space of **/26** or larger. |
239+
240+
1. Select **Review + create**.
241+
242+
1. Select **Create**.
243+
244+
### [PowerShell](#tab/powershell)
232245

233246
Create a public IP address for the Azure Bastion host with [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress). The following example creates a public IP address named *public-ip-bastion* in the *vnet-1* virtual network.
234247

@@ -258,7 +271,52 @@ $bastionParams = @{
258271
New-AzBastion @bastionParams -AsJob
259272
```
260273

261-
### Create a second virtual network
274+
### [CLI](#tab/cli)
275+
276+
Create a public IP address for the Azure Bastion host with [az network public-ip create](/cli/azure/network/public-ip). The following example creates a public IP address named *public-ip-bastion* in the *vnet-1* virtual network.
277+
278+
```azurecli-interactive
279+
az network public-ip create \
280+
--resource-group test-rg \
281+
--name public-ip-bastion \
282+
--location eastus2 \
283+
--allocation-method Static \
284+
--sku Standard
285+
```
286+
287+
Create an Azure Bastion host with [az network bastion create](/cli/azure/network/bastion). The following example creates an Azure Bastion host named *bastion* in the *AzureBastionSubnet* subnet of the *vnet-1* virtual network. Azure Bastion is used to securely connect Azure virtual machines without exposing them to the public internet.
288+
289+
```azurecli-interactive
290+
az network bastion create \
291+
--resource-group test-rg \
292+
--name bastion \
293+
--vnet-name vnet-1 \
294+
--public-ip-address public-ip-bastion \
295+
--location eastus2 \
296+
--sku Basic \
297+
--no-wait
298+
```
299+
300+
---
301+
302+
## Create a second virtual network
303+
304+
### [Portal](#tab/portal)
305+
306+
Repeat the previous steps to create a second virtual network with the following values:
307+
308+
>[!NOTE]
309+
>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.
310+
311+
| Setting | Value |
312+
| --- | --- |
313+
| Name | **vnet-2** |
314+
| Address space | **10.1.0.0/16** |
315+
| Resource group | **test-rg** |
316+
| Subnet name | **subnet-1** |
317+
| Subnet address range | **10.1.0.0/24** |
318+
319+
### [PowerShell](#tab/powershell)
262320

263321
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**.
264322

@@ -294,6 +352,24 @@ $virtualNetwork2 | Set-AzVirtualNetwork
294352

295353
### [CLI](#tab/cli)
296354

355+
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**.
356+
357+
>[!NOTE]
358+
>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.
359+
360+
```azurecli-interactive
361+
az network vnet create \
362+
--name vnet-2 \
363+
--resource-group test-rg \
364+
--address-prefixes 10.1.0.0/16 \
365+
--subnet-name subnet-1 \
366+
--subnet-prefix 10.1.0.0/24
367+
```
368+
369+
---
370+
371+
### [Portal](#tab/portal)
372+
297373
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**.
298374

299375
```azurecli-interactive
@@ -316,8 +392,6 @@ az network vnet subnet create \
316392
--address-prefix 10.0.1.0/24
317393
```
318394

319-
### Create Azure Bastion
320-
321395
Create a public IP address for the Azure Bastion host with [az network public-ip create](/cli/azure/network/public-ip). The following example creates a public IP address named *public-ip-bastion* in the *vnet-1* virtual network.
322396

323397
```azurecli-interactive
@@ -342,13 +416,6 @@ az network bastion create \
342416
--no-wait
343417
```
344418

345-
### Create a second virtual network
346-
347-
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**.
348-
349-
>[!NOTE]
350-
>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.
351-
352419
```azurecli-interactive
353420
az network vnet create \
354421
--name vnet-2 \
@@ -360,6 +427,120 @@ az network vnet create \
360427

361428
---
362429

430+
## Deploy Azure Bastion
431+
432+
### [Portal](#tab/portal)
433+
434+
Azure Bastion uses your browser to connect to virtual machines (VMs) in your virtual network over secure shell (SSH) or remote desktop protocol (RDP) by using their private IP addresses. The virtual machines don't need public IP addresses, client software, or special configuration. For more information about Azure Bastion, see [Azure Bastion](/azure/bastion/bastion-overview).
435+
436+
>[!NOTE]
437+
>[!INCLUDE [Pricing](~/reusable-content/ce-skilling/azure/includes/bastion-pricing.md)]
438+
439+
1. In the search box at the top of the portal, enter **Bastion**. Select **Bastions** in the search results.
440+
441+
1. Select **+ Create**.
442+
443+
1. In the **Basics** tab of **Create a Bastion**, enter, or select the following information:
444+
445+
| Setting | Value |
446+
|---|---|
447+
| **Project details** | |
448+
| Subscription | Select your subscription. |
449+
| Resource group | Select **test-rg**. |
450+
| **Instance details** | |
451+
| Name | Enter **bastion**. |
452+
| Region | Select **East US 2**. |
453+
| Tier | Select **Developer**. |
454+
| **Configure virtual networks** | |
455+
| Virtual network | Select **vnet-1**. |
456+
| Subnet | The **AzureBastionSubnet** is created automatically with an address space of **/26** or larger. |
457+
458+
1. Select **Review + create**.
459+
460+
1. Select **Create**.
461+
462+
### [PowerShell](#tab/powershell)
463+
464+
Create a public IP address for the Azure Bastion host with [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress). The following example creates a public IP address named *public-ip-bastion* in the *vnet-1* virtual network.
465+
466+
```azurepowershell-interactive
467+
$publicIpParams = @{
468+
ResourceGroupName = "test-rg"
469+
Name = "public-ip-bastion"
470+
Location = "EastUS2"
471+
AllocationMethod = "Static"
472+
Sku = "Standard"
473+
}
474+
New-AzPublicIpAddress @publicIpParams
475+
```
476+
477+
Create an Azure Bastion host with [New-AzBastion](/powershell/module/az.network/new-azbastion). The following example creates an Azure Bastion host named *bastion* in the *AzureBastionSubnet* subnet of the *vnet-1* virtual network. Azure Bastion is used to securely connect Azure virtual machines without exposing them to the public internet.
478+
479+
```azurepowershell-interactive
480+
$bastionParams = @{
481+
ResourceGroupName = "test-rg"
482+
Name = "bastion"
483+
VirtualNetworkName = "vnet-1"
484+
PublicIpAddressName = "public-ip-bastion"
485+
PublicIpAddressRgName = "test-rg"
486+
VirtualNetworkRgName = "test-rg"
487+
Sku = "Basic"
488+
}
489+
New-AzBastion @bastionParams -AsJob
490+
```
491+
492+
### [CLI](#tab/cli)
493+
494+
Create a public IP address for the Azure Bastion host with [az network public-ip create](/cli/azure/network/public-ip). The following example creates a public IP address named *public-ip-bastion* in the *vnet-1* virtual network.
495+
496+
```azurecli-interactive
497+
az network public-ip create \
498+
--resource-group test-rg \
499+
--name public-ip-bastion \
500+
--location eastus2 \
501+
--allocation-method Static \
502+
--sku Standard
503+
```
504+
505+
Create an Azure Bastion host with [az network bastion create](/cli/azure/network/bastion). The following example creates an Azure Bastion host named *bastion* in the *AzureBastionSubnet* subnet of the *vnet-1* virtual network. Azure Bastion is used to securely connect Azure virtual machines without exposing them to the public internet.
506+
507+
```azurecli-interactive
508+
az network bastion create \
509+
--resource-group test-rg \
510+
--name bastion \
511+
--vnet-name vnet-1 \
512+
--public-ip-address public-ip-bastion \
513+
--location eastus2 \
514+
--sku Basic \
515+
--no-wait
516+
```
517+
518+
---
519+
520+
## Create a second virtual network
521+
522+
### [Portal](#tab/portal)
523+
524+
Repeat the previous steps to create a second virtual network with the following values:
525+
526+
>[!NOTE]
527+
>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.
528+
529+
| Setting | Value |
530+
| --- | --- |
531+
| Name | **vnet-2** |
532+
| Address space | **10.1.0.0/16** |
533+
| Resource group | **test-rg** |
534+
| Subnet name | **subnet-1** |
535+
| Subnet address range | **10.1.0.0/24** |
536+
537+
### [PowerShell](#tab/powershell)
538+
539+
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**.
540+
541+
>[!NOTE]
542+
>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.
543+
363544
### [Portal](#tab/portal)
364545

365546
<a name="peer-virtual-networks"></a>

0 commit comments

Comments
 (0)