Skip to content

Commit 29a05df

Browse files
committed
docs: Rewrite VMs from Windows/IIS to Ubuntu/NGINX with Run Command
1 parent a558bf1 commit 29a05df

1 file changed

Lines changed: 35 additions & 55 deletions

File tree

articles/dns/tutorial-alias-tm.md

Lines changed: 35 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: dns
66
author: asudbring
77
ms.service: azure-dns
88
ms.topic: tutorial
9-
ms.date: 07/11/2025
9+
ms.date: 03/03/2026
1010
ms.author: allensu
1111
ms.custom:
1212
- template-tutorial #Required; leave this attribute/value as-is.
@@ -24,7 +24,6 @@ In this tutorial, you learn how to:
2424
> [!div class="checklist"]
2525
> * Create a virtual network and a subnet.
2626
> * Create a web server virtual machine with a public IP.
27-
> * Deploy Azure Bastion for secure VM access.
2827
> * Add a DNS label to a public IP.
2928
> * Create a Traffic Manager profile.
3029
> * Create an alias record.
@@ -91,11 +90,11 @@ Create a virtual network and a subnet to place your web servers in.
9190

9291
## Create web server virtual machines
9392

94-
Create two Windows Server virtual machines, and install IIS web server on them, and then add DNS labels to their public IPs.
93+
Create two Linux virtual machines, install NGINX web server on them, and then add DNS labels to their public IPs.
9594

9695
### Create the virtual machines
9796

98-
Create two Windows Server 2019 virtual machines.
97+
Create two Ubuntu virtual machines.
9998

10099
1. In the Azure portal, enter *virtual machine* in the search box at the top of the portal, and then select **Virtual machines** from the search results.
101100
2. In **Virtual machines**, select **+ Create** and then select **Azure virtual machine**.
@@ -107,16 +106,17 @@ Create two Windows Server 2019 virtual machines.
107106
| Subscription | Select your Azure subscription. |
108107
| Resource Group | Select **TMResourceGroup**. |
109108
| **Instance details** | |
110-
| Virtual machine name | Enter *Web-01*. |
109+
| Virtual machine name | Enter *web-01*. |
111110
| Region | Select **(US) East US**. |
112111
| Availability options | Select **No infrastructure redundancy required**. |
113112
| Security type | Select **Standard**. |
114-
| Image | Select **Windows Server 2019 Datacenter - Gen2**. |
113+
| Image | Select **Ubuntu Server 24.04 LTS - x64 Gen2**. |
115114
| Size | Select your VM size. |
116115
| **Administrator account** | |
116+
| Authentication type | Select **SSH public key**. |
117117
| Username | Enter a username. |
118-
| Password | Enter a password. |
119-
| Confirm password | Reenter the password. |
118+
| SSH public key source | Select **Generate new key pair**. |
119+
| Key pair name | Enter a name for the key pair. |
120120
| **Inbound port rules** | |
121121
| Public inbound ports | Select **None**. |
122122

@@ -129,85 +129,65 @@ Create two Windows Server 2019 virtual machines.
129129
| **Network interface** | |
130130
| Virtual network | Select **myTMVNet**. |
131131
| Subnet | Select **WebSubnet**. |
132-
| Public IP | Select **Create new**, and then enter *Web-01-ip* in **Name**. </br> Select **Basic** for the **SKU**, and **Static** for the **Assignment**. |
132+
| Public IP | Select **Create new**, and then enter *web-01-ip* in **Name**. </br> Select **Basic** for the **SKU**, and **Static** for the **Assignment**. |
133133
| NIC network security group | Select **Basic**. |
134134
| Public inbound ports | Select **Allow selected ports**. |
135135
| Select inbound ports | Select **HTTP (80)** and **HTTPS (443)**. |
136136

137137
6. Select **Review + create**.
138138
7. Review the settings, and then select **Create**.
139-
8. Repeat previous steps to create the second virtual machine. Enter *Web-02* in the **Virtual machine name** and *Web-02-ip* in the **Name** of **Public IP**. For the other settings, use the same information from the previous steps used with first virtual machine.
139+
8. Repeat previous steps to create the second virtual machine. Enter *web-02* in the **Virtual machine name** and *web-02-ip* in the **Name** of **Public IP**. For the other settings, use the same information from the previous steps used with first virtual machine.
140140

141141
Each virtual machine deployment may take a few minutes to complete.
142142

143-
### Deploy Azure Bastion
143+
> [!NOTE]
144+
> The network security group rules block inbound SSH access from the internet. To run commands on the virtual machines, use the **Run command** feature in the Azure portal or deploy Azure Bastion. For more information about Azure Bastion, see [Quickstart: Deploy Azure Bastion with default settings](../bastion/quickstart-host-portal.md).
144145
145-
Azure Bastion uses your browser to connect to VMs in your virtual network over RDP by using their private IP addresses. The VMs don't need client software or special configuration. For more information about Azure Bastion, see [Azure Bastion](/azure/bastion/bastion-overview).
146+
### Install NGINX web server
146147

147-
> [!NOTE]
148-
> [!INCLUDE [Pricing](~/reusable-content/ce-skilling/azure/includes/bastion-pricing.md)]
148+
Install NGINX on both **web-01** and **web-02** virtual machines using the **Run command** feature in the Azure portal.
149149

150-
1. In the search box at the top of the portal, enter **Bastion**. Select **Bastions** in the search results.
151-
2. Select **+ Create**.
152-
3. In the **Basics** tab of **Create a Bastion**, enter or select the following information:
150+
1. In the search box at the top of the portal, enter *virtual machine*. Select **Virtual machines** in the search results.
153151

154-
| Setting | Value |
155-
|---|---|
156-
| **Project details** | |
157-
| Subscription | Select your subscription. |
158-
| Resource group | Select **TMResourceGroup**. |
159-
| **Instance details** | |
160-
| Name | Enter **bastion**. |
161-
| Region | Select **East US**. |
162-
| Tier | Select **Developer**. |
163-
| **Configure virtual networks** | |
164-
| Virtual network | Select **myTMVNet**. |
152+
1. Select the **web-01** virtual machine.
165153

166-
4. Select **Review + create**.
167-
5. Select **Create**.
154+
1. In the **Operations** section of the left menu, select **Run command**.
168155

169-
### Install IIS web server
156+
1. Select **RunShellScript**.
170157

171-
Install IIS on both **Web-01** and **Web-02** virtual machines.
158+
1. In the **Run Command Script** pane, enter the following command:
172159

173-
1. In the search box at the top of the portal, enter **Virtual machine**. Select **Virtual machines** in the search results.
174-
2. In **Virtual machines**, select **Web-01**.
175-
3. Select **Connect** then **Connect via Bastion** in the **Overview** section.
176-
4. Enter the username and password that you created when you created the virtual machine, then select **Connect**.
177-
5. On the **Server Manager** dashboard, select **Manage** then **Add Roles and Features**.
178-
6. Select **Server Roles** or select **Next** three times. On the **Server Roles** screen, select **Web Server (IIS)**.
179-
7. Select **Add Features**, and then select **Next**.
160+
```bash
161+
sudo apt-get update && sudo apt-get install -y nginx && echo 'Hello World from web-01' | sudo tee /var/www/html/index.html
162+
```
180163

181-
:::image type="content" source="./media/tutorial-alias-tm/iis-web-server-installation.png" alt-text="Screenshot of Add Roles and Features Wizard in Windows Server 2019 showing how to install the I I S Web Server by adding the Web Server role.":::
164+
1. Select **Run**.
182165

183-
8. Select **Confirmation** or select **Next** three times, and then select **Install**. The installation process takes a few minutes to finish.
184-
9. After the installation finishes, select **Close**.
185-
10. Go to *C:\inetpub\wwwroot* and open *iisstart.htm* with Notepad or any editor of your choice to edit the default IIS web page.
186-
11. Replace all the text in the file with `Hello World from Web-01` and save the changes to *iisstart.htm*.
187-
12. Open a web browser. Browse to **localhost** to verify that the default IIS web page appears.
166+
1. Wait for the command to complete. The output displays the installation progress and finishes when NGINX is installed.
188167

189-
:::image type="content" source="./media/tutorial-alias-tm/iis-on-web-01-vm-in-web-browser.png" alt-text="Screenshot of Internet Explorer showing the I I S Web Server default page of first virtual machine.":::
168+
1. Repeat the previous steps for the **web-02** virtual machine. Use the following command instead:
190169

191-
13. Close the Bastion session.
192-
14. Repeat previous steps to install IIS web server on **Web-02** virtual machine. Use `Hello World from Web-02` to replace all the text in *iisstart.htm*.
170+
```bash
171+
sudo apt-get update && sudo apt-get install -y nginx && echo 'Hello World from web-02' | sudo tee /var/www/html/index.html
172+
```
193173

194174
### Add a DNS label
195175

196176
Public IP addresses need DNS labels to work with Traffic Manager.
197177

198178
1. In the Azure portal, enter *TMResourceGroup* in the search box at the top of the portal, and then select **TMResourceGroup** from the search results.
199-
2. In the **TMResourceGroup** resource group, select the **Web-01-ip** public IP address.
179+
1. In the **TMResourceGroup** resource group, select the **web-01-ip** public IP address.
200180
3. Under **Settings**, select **Configuration**.
201181
4. Enter *web01pip* in the **DNS name label**.
202182
5. Select **Save**.
203183

204184
:::image type="content" source="./media/tutorial-alias-tm/ip-dns-name-label-inline.png" alt-text="Screenshot of the Configuration page of Azure Public IP Address showing D N S name label." lightbox="./media/tutorial-alias-tm/ip-dns-name-label-expanded.png":::
205185

206-
6. Repeat the previous steps for the **Web-02-ip** public IP address and enter *web02pip* in the **DNS name label**.
186+
6. Repeat the previous steps for the **web-02-ip** public IP address and enter *web02pip* in the **DNS name label**.
207187

208188
## Create a Traffic Manager profile
209189

210-
1. In the **Overview** page of **Web-01-ip** public IP address, note the IP address for later use. Repeat this step for the **Web-02-ip** public IP address.
190+
1. In the **Overview** page of **web-01-ip** public IP address, note the IP address for later use. Repeat this step for the **web-02-ip** public IP address.
211191
2. In the Azure portal, enter *Traffic Manager profile* in the search box at the top of the portal, and then select **Traffic Manager profiles**.
212192
3. Select **+ Create**.
213193
4. In the **Create Traffic Manager profile** page, enter or select the following information:
@@ -229,7 +209,7 @@ Public IP addresses need DNS labels to work with Traffic Manager.
229209
|---------|-------|
230210
| Type | Select **External endpoint**. |
231211
| Name | Enter *EP-Web01*. |
232-
| Fully qualified domain name (FQDN) or IP | Enter the IP address for **Web-01-ip** that you noted previously. |
212+
| Fully qualified domain name (FQDN) or IP | Enter the IP address for **web-01-ip** that you noted previously. |
233213
| Priority | Enter *1*. |
234214

235215
:::image type="content" source="./media/tutorial-alias-tm/add-endpoint-tm-inline.png" alt-text="Screenshot of the Endpoints page in Traffic Manager profile showing selected settings for adding an endpoint." lightbox="./media/tutorial-alias-tm/add-endpoint-tm-expanded.png":::
@@ -241,7 +221,7 @@ Public IP addresses need DNS labels to work with Traffic Manager.
241221
|---------|-------|
242222
| Type | Select **External endpoint**. |
243223
| Name | Enter *EP-Web02*. |
244-
| Fully qualified domain name (FQDN) or IP | Enter the IP address for **Web-02-ip** that you noted previously. |
224+
| Fully qualified domain name (FQDN) or IP | Enter the IP address for **web-02-ip** that you noted previously. |
245225
| Priority | Enter *2*. |
246226

247227
## Create an alias record
@@ -263,9 +243,9 @@ Create an alias record that points to the Traffic Manager profile.
263243

264244
## Test the alias record
265245

266-
1. From a web browser, browse to `contoso.com` or your apex domain name. You see the IIS default page with `Hello World from Web-01`. The Traffic Manager directed traffic to **Web-01** IIS web server because it has the highest priority. Close the web browser and shut down **Web-01** virtual machine. Wait a few minutes for the virtual machine to completely shut down.
246+
1. From a web browser, browse to `contoso.com` or your apex domain name. You see the NGINX page with `Hello World from web-01`. The Traffic Manager directed traffic to **web-01** because it has the highest priority. Close the web browser and shut down **web-01** virtual machine. Wait a few minutes for the virtual machine to completely shut down.
267247
2. Open a new web browser, and browse again to `contoso.com` or your apex domain name.
268-
3. You should see the IIS default page with `Hello World from Web-02`. The Traffic Manager handled the situation and directed traffic to the second IIS server after shutting down the first server that has the highest priority.
248+
3. You should see the NGINX page with `Hello World from web-02`. The Traffic Manager handled the situation and directed traffic to the second web server after shutting down the first server that has the highest priority.
269249

270250
## Clean up resources
271251

0 commit comments

Comments
 (0)