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
Copy file name to clipboardExpand all lines: articles/dns/tutorial-alias-tm.md
+35-55Lines changed: 35 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ services: dns
6
6
author: asudbring
7
7
ms.service: azure-dns
8
8
ms.topic: tutorial
9
-
ms.date: 07/11/2025
9
+
ms.date: 03/03/2026
10
10
ms.author: allensu
11
11
ms.custom:
12
12
- template-tutorial #Required; leave this attribute/value as-is.
@@ -24,7 +24,6 @@ In this tutorial, you learn how to:
24
24
> [!div class="checklist"]
25
25
> * Create a virtual network and a subnet.
26
26
> * Create a web server virtual machine with a public IP.
27
-
> * Deploy Azure Bastion for secure VM access.
28
27
> * Add a DNS label to a public IP.
29
28
> * Create a Traffic Manager profile.
30
29
> * Create an alias record.
@@ -91,11 +90,11 @@ Create a virtual network and a subnet to place your web servers in.
91
90
92
91
## Create web server virtual machines
93
92
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.
95
94
96
95
### Create the virtual machines
97
96
98
-
Create two Windows Server 2019 virtual machines.
97
+
Create two Ubuntu virtual machines.
99
98
100
99
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.
101
100
2. In **Virtual machines**, select **+ Create** and then select **Azure virtual machine**.
@@ -107,16 +106,17 @@ Create two Windows Server 2019 virtual machines.
107
106
| Subscription | Select your Azure subscription. |
| Authentication type | Select **SSH public key**. |
117
117
| 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. |
120
120
|**Inbound port rules**||
121
121
| Public inbound ports | Select **None**. |
122
122
@@ -129,85 +129,65 @@ Create two Windows Server 2019 virtual machines.
129
129
|**Network interface**||
130
130
| Virtual network | Select **myTMVNet**. |
131
131
| 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**. |
133
133
| NIC network security group | Select **Basic**. |
134
134
| Public inbound ports | Select **Allow selected ports**. |
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.
140
140
141
141
Each virtual machine deployment may take a few minutes to complete.
142
142
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).
144
145
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).
Install NGINX on both **web-01** and **web-02** virtual machines using the **Run command** feature in the Azure portal.
149
149
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.
153
151
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.
165
153
166
-
4. Select **Review + create**.
167
-
5. Select **Create**.
154
+
1. In the **Operations** section of the left menu, select **Run command**.
168
155
169
-
### Install IIS web server
156
+
1. Select **RunShellScript**.
170
157
171
-
Install IIS on both **Web-01** and **Web-02** virtual machines.
158
+
1. In the **Run Command Script** pane, enter the following command:
172
159
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
+
```
180
163
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**.
182
165
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.
188
167
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:
190
169
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
+
```
193
173
194
174
### Add a DNS label
195
175
196
176
Public IP addresses need DNS labels to work with Traffic Manager.
197
177
198
178
1. In the Azure portal, enter *TMResourceGroup*in the search box at the top of the portal, and thenselect**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, selectthe**web-01-ip** public IP address.
200
180
3. Under **Settings**, select**Configuration**.
201
181
4. Enter *web01pip*in the **DNS name label**.
202
182
5. Select **Save**.
203
183
204
184
:::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":::
205
185
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 forthe **web-02-ip** public IP address and enter *web02pip*in the **DNS name label**.
207
187
208
188
## Create a Traffic Manager profile
209
189
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.
211
191
2. In the Azure portal, enter *Traffic Manager profile*in the search box at the top of the portal, and thenselect**Traffic Manager profiles**.
212
192
3. Select **+ Create**.
213
193
4. In the **Create Traffic Manager profile** page, enter or selectthe following information:
@@ -229,7 +209,7 @@ Public IP addresses need DNS labels to work with Traffic Manager.
229
209
|---------|-------|
230
210
| Type | Select **External endpoint**. |
231
211
| 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. |
233
213
| Priority | Enter *1*. |
234
214
235
215
:::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.
241
221
|---------|-------|
242
222
| Type | Select **External endpoint**. |
243
223
| 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. |
245
225
| Priority | Enter *2*. |
246
226
247
227
## Create an alias record
@@ -263,9 +243,9 @@ Create an alias record that points to the Traffic Manager profile.
263
243
264
244
## Test the alias record
265
245
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.
267
247
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.
0 commit comments