You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task 544785: Replace jump server with Azure Bastion in deploy-cli.md
Changes:
- Replaced Jump-SN subnet with AzureBastionSubnet (10.0.3.0/26)
- Removed Srv-Jump VM (Windows Server jump server)
- Changed Srv-Work VM from Windows Server 2016 to Ubuntu 22.04 LTS
- Updated VM authentication to use SSH keys with azure-generated keys
- Added cloud-init configuration to install Nginx on Srv-Work
- Added Azure CLI commands to deploy Azure Bastion (Basic SKU)
- Updated testing section to use Bastion SSH instead of RDP jump server
- Changed PowerShell commands to bash/curl commands for Linux testing
- Updated ms.date to 01/22/2026
Related to parent work item #545010 (Sprint 2 Bastion updates)
Copy file name to clipboardExpand all lines: articles/firewall/deploy-cli.md
+53-39Lines changed: 53 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: firewall
5
5
author: duongau
6
6
ms.service: azure-firewall
7
7
ms.custom: devx-track-azurecli
8
-
ms.date: 10/31/2022
8
+
ms.date: 01/22/2026
9
9
ms.author: duau
10
10
ms.topic: how-to
11
11
#Customer intent: As an administrator new to this service, I want to control outbound network access from resources located in an Azure subnet.
@@ -27,7 +27,7 @@ For this article, you create a simplified single VNet with three subnets for eas
27
27
28
28
***AzureFirewallSubnet** - the firewall is in this subnet.
29
29
***Workload-SN** - the workload server is in this subnet. This subnet's network traffic goes through the firewall.
30
-
***Jump-SN** - The "jump" server is in this subnet. The jump server has a public IP address that you can connect to using Remote Desktop. From there, you can then connect to (using another Remote Desktop) the workload server.
30
+
***AzureBastionSubnet** - Azure Bastion is in this subnet, providing secure access to the workload server.
31
31
32
32
:::image type="content" source="media/tutorial-firewall-rules-portal/Tutorial_network.png" alt-text="Diagram of network infrastructure." lightbox="media/tutorial-firewall-rules-portal/Tutorial_network.png":::
33
33
@@ -81,32 +81,13 @@ az network vnet subnet create \
81
81
--vnet-name Test-FW-VN \
82
82
--address-prefix 10.0.2.0/24
83
83
az network vnet subnet create \
84
-
--name Jump-SN \
84
+
--name AzureBastionSubnet \
85
85
--resource-group Test-FW-RG \
86
86
--vnet-name Test-FW-VN \
87
-
--address-prefix 10.0.3.0/24
87
+
--address-prefix 10.0.3.0/26
88
88
```
89
89
90
-
### Create virtual machines
91
-
92
-
Now create the jump and workload virtual machines, and place them in the appropriate subnets.
93
-
When prompted, type a password for the virtual machine.
94
-
95
-
Create the Srv-Jump virtual machine.
96
-
97
-
```azurecli-interactive
98
-
az vm create \
99
-
--resource-group Test-FW-RG \
100
-
--name Srv-Jump \
101
-
--location eastus \
102
-
--image win2016datacenter \
103
-
--vnet-name Test-FW-VN \
104
-
--subnet Jump-SN \
105
-
--admin-username azureadmin
106
-
az vm open-port --port 3389 --resource-group Test-FW-RG --name Srv-Jump
107
-
```
108
-
109
-
90
+
### Create a virtual machine
110
91
111
92
Create a NIC for Srv-Work with specific DNS server IP addresses and no public IP address to test with.
112
93
@@ -120,17 +101,29 @@ az network nic create \
120
101
--dns-servers <replace with External DNS ip #1> <replace with External DNS ip #2>
121
102
```
122
103
123
-
Now create the workload virtual machine.
124
-
When prompted, type a password for the virtual machine.
104
+
Now create the workload virtual machine. The following command creates an Ubuntu Server 22.04 LTS VM with SSH key authentication and installs Nginx. When prompted, save the generated private key to a `.pem` file for use when connecting through Azure Bastion.
125
105
126
106
```azurecli-interactive
127
107
az vm create \
128
108
--resource-group Test-FW-RG \
129
109
--name Srv-Work \
130
110
--location eastus \
131
-
--image win2016datacenter \
111
+
--image Ubuntu2204 \
132
112
--nics Srv-Work-NIC \
133
-
--admin-username azureadmin
113
+
--admin-username azureuser \
114
+
--generate-ssh-keys \
115
+
--custom-data cloud-init.txt
116
+
```
117
+
118
+
Create a `cloud-init.txt` file with the following content to install Nginx:
119
+
120
+
```yaml
121
+
#cloud-config
122
+
package_upgrade: true
123
+
packages:
124
+
- nginx
125
+
runcmd:
126
+
- echo '<h1>'$(hostname)'</h1>' | sudo tee /var/www/html/index.html
Note the private IP address. You'll use it later when you create the default route.
169
162
163
+
## Deploy Azure Bastion
164
+
165
+
Deploy Azure Bastion to securely connect to the Srv-Work virtual machine without requiring public IP addresses or a jump server.
166
+
167
+
```azurecli-interactive
168
+
az network public-ip create \
169
+
--resource-group Test-FW-RG \
170
+
--name bastion-pip \
171
+
--sku Standard \
172
+
--location eastus
173
+
az network bastion create \
174
+
--name Test-Bastion \
175
+
--public-ip-address bastion-pip \
176
+
--resource-group Test-FW-RG \
177
+
--vnet-name Test-FW-VN \
178
+
--location eastus \
179
+
--sku Basic
180
+
```
181
+
182
+
> [!NOTE]
183
+
> Azure Bastion deployment can take approximately 10 minutes to complete.
184
+
170
185
## Create a default route
171
186
172
187
Create a route table, with BGP route propagation disabled
@@ -251,28 +266,27 @@ Now, test the firewall to confirm that it works as expected.
251
266
-n Srv-Work
252
267
```
253
268
254
-
1.Connect a remote desktop to **Srv-Jump** virtual machine, and sign in. From there, open a remote desktop connection to the **Srv-Work**private IP address and sign in.
269
+
1.In the Azure portal, navigate to the **Srv-Work** virtual machine and select **Connect**> **Connect via Bastion**.
255
270
256
-
3. On **SRV-Work**, open a PowerShell window and run the following commands:
271
+
1. Provide the username **azureuser** and upload the private key `.pem` file that was generated when you created the VM. Select **Connect** to open an SSH session.
257
272
258
-
```
273
+
1. In the SSH session, run the following commands to test DNS resolution:
274
+
275
+
```bash
259
276
nslookup www.google.com
260
277
nslookup www.microsoft.com
261
278
```
262
279
263
280
Both commands should return answers, showing that your DNS queries are getting through the firewall.
264
281
265
-
1. Run the following commands:
266
-
267
-
```
268
-
Invoke-WebRequest -Uri https://www.microsoft.com
269
-
Invoke-WebRequest -Uri https://www.microsoft.com
282
+
1. Run the following commands to test web access:
270
283
271
-
Invoke-WebRequest -Uri <Replace with external website>
272
-
Invoke-WebRequest -Uri <Replace with external website>
284
+
```bash
285
+
curl https://www.microsoft.com
286
+
curl https://www.google.com
273
287
```
274
288
275
-
The `www.microsoft.com`requests should succeed, and the other `External Website` requests should fail. This demonstrates that your firewall rules are operating as expected.
289
+
The `www.microsoft.com`request should succeed and return HTML content, while the `www.google.com` request should fail or time out. This demonstrates that your firewall rules are operating as expected.
276
290
277
291
So now you've verified that the firewall rules are working:
0 commit comments