Skip to content

Commit 2980aff

Browse files
Merge pull request #310953 from asudbring/tsk544783-sfi-bastion
Simplify Firewall hybrid network tutorial testing procedure
2 parents 5c07f8f + 9da25ce commit 2980aff

1 file changed

Lines changed: 81 additions & 50 deletions

File tree

articles/firewall/tutorial-hybrid-portal-policy.md

Lines changed: 81 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: firewall
55
author: duau
66
ms.service: azure-firewall
77
ms.topic: tutorial
8-
ms.date: 08/05/2024
8+
ms.date: 01/27/2026
99
ms.author: duau
1010
ms.custom: sfi-image-nochange
1111
#Customer intent: As an administrator, I want to control network access from an on-premises network to an Azure virtual network.
@@ -36,7 +36,7 @@ In this tutorial, you learn how to:
3636
> * Create and connect the VPN gateways
3737
> * Peer the hub and spoke virtual networks
3838
> * Create the routes
39-
> * Create the virtual machines
39+
> * Create the virtual machine
4040
> * Test the firewall
4141
4242
If you want to use Azure PowerShell instead to complete this procedure, see [Deploy and configure Azure Firewall in a hybrid network using Azure PowerShell](tutorial-hybrid-ps.md).
@@ -190,19 +190,6 @@ First, add a network rule to allow web traffic.
190190
1. For **Destination type**, select **IP address**.
191191
1. For **Destination**, type **10.6.0.0/16**.
192192

193-
Now add a rule to allow RDP traffic.
194-
195-
On the second rule row, type the following information:
196-
197-
1. **Name**, type **AllowRDP**.
198-
3. For **Source type**, select **IP address**.
199-
4. For **Source**, type **192.168.1.0/24**.
200-
2. For **Protocol**, select **TCP**.
201-
1. For **Destination Ports**, type **3389**.
202-
1. For **Destination type**, select **IP address**.
203-
1. For **Destination**, type **10.6.0.0/16**
204-
1. Select **Add**.
205-
206193
## Create and connect the VPN gateways
207194

208195
The hub and on-premises virtual networks are connected via VPN gateways.
@@ -386,17 +373,21 @@ Now create the spoke workload and on-premises virtual machines, and place them i
386373

387374
### Create the workload virtual machine
388375

389-
Create a virtual machine in the spoke virtual network, running IIS, with no public IP address.
376+
Create a virtual machine in the spoke virtual network, running NGINX, with no public IP address.
390377

391378
1. From the Azure portal home page, select **Create a resource**.
392-
2. Under **Popular Marketplace products**, select **Windows Server 2019 Datacenter**.
379+
2. Under **Popular Marketplace products**, select **Ubuntu Server 22.04 LTS**.
393380
3. Enter these values for the virtual machine:
394381
- **Resource group** - Select **FW-Hybrid-Test**
395382
- **Virtual machine name**: *VM-Spoke-01*
396-
- **Region** - Same region that you're used previously
397-
- **User name**: \<type a user name\>
398-
- **Password**: \<type a password\>
399-
4. For **Public inbound ports**, select **Allow selected ports**, and then select **HTTP (80)**, and **RDP (3389)**.
383+
- **Region** - Same region that you used previously
384+
- **Image** - Ubuntu Server 22.04 LTS - x64 Gen2
385+
- **Size** - Standard_B2s
386+
- **Authentication type** - SSH public key
387+
- **Username**: **azureuser**
388+
- **SSH public key source** - Generate new key pair
389+
- **Key pair name** - **VM-Spoke-01_key**
390+
4. For **Public inbound ports**, select **None**.
400391
4. Select **Next:Disks**.
401392
5. Accept the defaults and select **Next: Networking**.
402393
6. Select **VNet-Spoke** for the virtual network and the subnet is **SN-Workload**.
@@ -405,68 +396,108 @@ Create a virtual machine in the spoke virtual network, running IIS, with no publ
405396
1. Select **Next : Monitoring**.
406397
1. For **Boot diagnostics**, Select **Disable**.
407398
1. Select **Review+Create**, review the settings on the summary page, and then select **Create**.
399+
1. On the **Generate new key pair** dialog, select **Download private key and create resource**. Save the key file as **VM-Spoke-01_key.pem**.
408400

409-
### Install IIS
401+
### Install Nginx
410402

411-
After the virtual machine is created, install IIS.
403+
After the virtual machine is created, install Nginx web server.
412404

413-
1. From the Azure portal, open the Cloud Shell and make sure that it's set to **PowerShell**.
414-
2. Run the following command to install IIS on the virtual machine and change the location if necessary:
405+
1. From the Azure portal, open the Cloud Shell and make sure that it's set to **Bash**.
406+
2. Run the following command to install Nginx on the virtual machine:
415407

416-
```azurepowershell-interactive
417-
Set-AzVMExtension `
418-
-ResourceGroupName FW-Hybrid-Test `
419-
-ExtensionName IIS `
420-
-VMName VM-Spoke-01 `
421-
-Publisher Microsoft.Compute `
422-
-ExtensionType CustomScriptExtension `
423-
-TypeHandlerVersion 1.4 `
424-
-SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}' `
425-
-Location EastUS
408+
```azurecli-interactive
409+
az vm run-command invoke \
410+
--resource-group FW-Hybrid-Test \
411+
--name VM-Spoke-01 \
412+
--command-id RunShellScript \
413+
--scripts "sudo apt-get update && sudo apt-get install -y nginx && echo '<h1>'$(hostname)'</h1>' | sudo tee /var/www/html/index.html"
426414
```
427415

428416
### Create the on-premises virtual machine
429417

430-
This is a virtual machine that you use to connect using Remote Desktop to the public IP address. From there, you then connect to the on-premises server through the firewall.
418+
This is a virtual machine that you use to connect using Azure Bastion. From there, you then connect to the spoke server through the firewall.
431419

432420
1. From the Azure portal home page, select **Create a resource**.
433-
2. Under **Popular Marketplace products**, select **Windows Server 2019 Datacenter**.
421+
2. Under **Popular Marketplace products**, select **Ubuntu Server 22.04 LTS**.
434422
3. Enter these values for the virtual machine:
435423
- **Resource group** - Select existing, and then select **FW-Hybrid-Test**.
436424
- **Virtual machine name** - *VM-Onprem*.
437425
- **Region** - Same region that you used previously.
438-
- **User name**: \<type a user name\>.
439-
- **Password**: \<type a user password\>.
440-
7. For **Public inbound ports**, select **Allow selected ports**, and then select **RDP (3389)**
426+
- **Image** - Ubuntu Server 22.04 LTS - x64 Gen2
427+
- **Size** - Standard_B2s
428+
- **Authentication type** - SSH public key
429+
- **Username**: **azureuser**
430+
- **SSH public key source** - Generate new key pair
431+
- **Key pair name** - **VM-Onprem_key**
432+
433+
7. For **Public inbound ports**, select **None**
441434
4. Select **Next:Disks**.
442435
5. Accept the defaults and select **Next:Networking**.
443436
6. Select **VNet-Onprem** for virtual network and the subnet is **SN-Corp**.
437+
444438
8. Select **Next:Management**.
445439
1. Select **Next : Monitoring**.
446440
1. For **Boot diagnostics**, select **Disable**.
447441
1. Select **Review+Create**, review the settings on the summary page, and then select **Create**.
442+
1. On the **Generate new key pair** dialog, select **Download private key and create resource**. Save the key file as **VM-Onprem_key.pem**.
448443

449444
[!INCLUDE [ephemeral-ip-note.md](~/reusable-content/ce-skilling/azure/includes/ephemeral-ip-note.md)]
450445

446+
## Deploy Azure Bastion
447+
448+
Now deploy Azure Bastion in the hub virtual network to provide secure access to the on-premises virtual machine.
449+
450+
1. Navigate to the **VNet-hub** virtual network.
451+
1. Select **Subnets** > **+ Subnet**.
452+
1. Configure the new subnet:
453+
- **Name**: **AzureBastionSubnet** (this exact name is required)
454+
- **Subnet address range**: **10.5.3.0/26**
455+
1. Select **Save**.
456+
457+
1. On the Azure portal menu, select **Create a resource**.
458+
1. Search for **Bastion** and select it.
459+
1. Select **Create**.
460+
1. Configure the Bastion deployment:
461+
462+
| Setting | Value |
463+
|---------|-------|
464+
| Subscription | Your subscription |
465+
| Resource group | **FW-Hybrid-Test** |
466+
| Name | **Hub-Bastion** |
467+
| Region | Same as your other resources |
468+
| Tier | **Developer** |
469+
| Virtual network | **VNet-hub** |
470+
| Subnet | **AzureBastionSubnet** (auto-selected) |
471+
| Public IP address | Create new |
472+
| Public IP address name | **Bastion-pip** |
473+
474+
1. Select **Review + create**.
475+
1. Select **Create**.
476+
477+
The deployment takes about 10 minutes to complete.
478+
451479
## Test the firewall
452480

453481
1. First, note the private IP address for **VM-spoke-01** virtual machine.
454482

455-
2. From the Azure portal, connect to the **VM-Onprem** virtual machine.
483+
2. From the Azure portal, navigate to the **VM-Onprem** virtual machine.
456484

457-
3. Open a web browser on **VM-Onprem**, and browse to http://\<VM-spoke-01 private IP\>.
485+
3. Select **Connect** > **Connect via Bastion**.
458486

459-
You should see the **VM-spoke-01** web page:
460-
![VM-Spoke-01 web page](media/tutorial-hybrid-portal/VM-Spoke-01-web.png)
487+
4. Select **Use SSH Private Key from Local File**.
461488

462-
4. From the **VM-Onprem** virtual machine, open a remote desktop to **VM-spoke-01** at the private IP address.
489+
5. For **Username**, type **azureuser**.
463490

464-
Your connection should succeed, and you should be able to sign in.
491+
6. Browse to and select the **VM-Onprem_key.pem** file you downloaded earlier.
465492

466-
So now you verified that the firewall rules are working:
493+
7. Select **Connect**.
467494

468-
- You can browse web server on the spoke virtual network.
469-
- You can connect to the server on the spoke virtual network using RDP.
495+
8. From the SSH session on **VM-Onprem**, test the web server on the spoke virtual network:
496+
497+
```bash
498+
curl http://<VM-spoke-01 private IP>
499+
```
500+
The web server will return a response.
470501

471502
Next, change the firewall network rule collection action to **Deny** to verify that the firewall rules work as expected.
472503

@@ -476,7 +507,7 @@ Next, change the firewall network rule collection action to **Deny** to verify t
476507
4. For **Rule collection action**, select **Deny**.
477508
5. Select **Save**.
478509

479-
Close any existing remote desktops before testing the changed rules. Now run the tests again. They should all fail this time.
510+
Now run the test again. The test should fail this time.
480511

481512
## Clean up resources
482513

0 commit comments

Comments
 (0)