Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9394946

Browse files
committedAug 30, 2019
Update for new UI, and address feedback from Sergio Figueiredo
1 parent f8353ce commit 9394946

File tree

5 files changed

+125
-92
lines changed

5 files changed

+125
-92
lines changed
 

‎articles/application-gateway/application-gateway-create-url-route-portal.md

Lines changed: 125 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@ title: Create an application gateway with URL path-based routing rules - Azure p
33
description: Learn how to create URL path-based routing rules for an application gateway and virtual machine scale set using the Azure portal.
44
services: application-gateway
55
author: vhorne
6-
manager: jpconnock
7-
tags: azure-resource-manager
8-
96
ms.service: application-gateway
107
ms.topic: article
11-
ms.workload: infrastructure-services
12-
ms.date: 3/26/2018
8+
ms.date: 08/31/2019
139
ms.author: victorh
1410

1511
---
@@ -36,144 +32,181 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
3632

3733
Log in to the Azure portal at [https://portal.azure.com](https://portal.azure.com)
3834

39-
## Create an application gateway
35+
## Create virtual machines
4036

41-
A virtual network is needed for communication between the resources that you create. Two subnets are created in this example: one for the application gateway, and the other for the backend servers. You can create a virtual network at the same time that you create the application gateway.
37+
In this example, you create three virtual machines to be used as backend servers for the application gateway. You also install IIS on the virtual machines to verify that the application gateway was successfully created.
4238

43-
1. Click **New** found on the upper left-hand corner of the Azure portal.
44-
2. Select **Networking** and then select **Application Gateway** in the Featured list.
45-
3. Enter these values for the application gateway:
39+
1. On the Azure portal, select **Create a resource**.
40+
2. Select **Windows Server 2016 Datacenter** in the Popular list.
41+
3. Enter these values for the virtual machine:
4642

47-
- *myAppGateway* - for the name of the application gateway.
48-
- *myResourceGroupAG* - for the new resource group.
43+
- **Resource group**, select **Create new**, and then type *myResourceGroupAG*.
44+
- **Virtual machine name**: *myVM1*
45+
- **Region**: *(US) East US*
46+
- **Username**: *azureuser*
47+
- **Password**: *Azure123456!*
4948

50-
![Create new application gateway](./media/application-gateway-create-url-route-portal/application-gateway-create.png)
5149

52-
4. Accept the default values for the other settings and then click **OK**.
53-
5. Click **Choose a virtual network**, click **Create new**, and then enter these values for the virtual network:
50+
4. Select **Next:Disks**.
51+
5. Select **Next:Networking**
52+
6. Select **Create new** and then type these values for the virtual network:
5453

5554
- *myVNet* - for the name of the virtual network.
5655
- *10.0.0.0/16* - for the virtual network address space.
57-
- *myAGSubnet* - for the subnet name.
56+
- *myBackendSubnet* for the first subnet name
57+
- *10.0.1.0/24* - for the subnet address space.
58+
- *myAGSubnet* - for the second subnet name.
5859
- *10.0.0.0/24* - for the subnet address space.
60+
7. Select **OK**.
5961

60-
![Create virtual network](./media/application-gateway-create-url-route-portal/application-gateway-vnet.png)
62+
8. Ensure that under **Network Interface**, **myBackendSubnet** is selected for the subnet, and then select **Next: Management**.
63+
9. Select **Off** to disable boot diagnostics.
64+
10. Click **Review + Create**, review the settings on the summary page, and then select **Create**.
65+
11. Create two more virtual machines, *myVM2* and *myVM3* and place them in the *MyVNet* virtual network and the *myBackendSubnet* subnet.
6166

62-
6. Click **OK** to create the virtual network and subnet.
63-
7. Click **Choose a public IP address**, click **Create new**, and then enter the name of the public IP address. In this example, the public IP address is named *myAGPublicIPAddress*. Accept the default values for the other settings and then click **OK**.
64-
8. Accept the default values for the Listener configuration, leave the Web application firewall disabled, and then click **OK**.
65-
9. Review the settings on the summary page, and then click **OK** to create the network resources and the application gateway. It may take several minutes for the application gateway to be created, wait until
66-
the deployment finishes successfully before moving on to the next section.
67+
### Install IIS
6768

68-
### Add a subnet
69+
1. Open the interactive shell and make sure that it is set to **PowerShell**.
6970

70-
1. Click **All resources** in the left-hand menu, and then click **myVNet** from the resources list.
71-
2. Click **Subnets**, and then click **Subnet**.
71+
![Install custom extension](./media/application-gateway-create-url-route-portal/application-gateway-extension.png)
7272

73-
![Create subnet](./media/application-gateway-create-url-route-portal/application-gateway-subnet.png)
73+
2. Run the following command to install IIS on the virtual machine:
7474

75-
3. Enter *myBackendSubnet* for the name of the subnet and then click **OK**.
75+
```azurepowershell
76+
$publicSettings = @{ "fileUris" = (,"https://raw.githubusercontent.com/Azure/azure-docs-powershell-samples/master/application-gateway/iis/appgatewayurl.ps1"); "commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File appgatewayurl.ps1" }
77+
Set-AzVMExtension `
78+
-ResourceGroupName myResourceGroupAG `
79+
-Location eastus `
80+
-ExtensionName IIS `
81+
-VMName myVM1 `
82+
-Publisher Microsoft.Compute `
83+
-ExtensionType CustomScriptExtension `
84+
-TypeHandlerVersion 1.4 `
85+
-Settings $publicSettings
86+
```
7687
77-
## Create virtual machines
88+
3. Create two more virtual machines and install IIS using the steps that you just finished. Enter the names of *myVM2* and *myVM3* for the names and for the values of VMName in Set-AzVMExtension.
7889
79-
In this example, you create three virtual machines to be used as backend servers for the application gateway. You also install IIS on the virtual machines to verify that the application gateway was successfully created.
90+
## Create an application gateway
8091
81-
1. Click **New**.
82-
2. Click **Compute** and then select **Windows Server 2016 Datacenter** in the Featured list.
83-
3. Enter these values for the virtual machine:
92+
1. Select **Create a resource** on the left menu of the Azure portal. The **New** window appears.
8493
85-
- *myVM1* - for the name of the virtual machine.
86-
- *azureuser* - for the administrator user name.
87-
- *Azure123456!* for the password.
88-
- Select **Use existing**, and then select *myResourceGroupAG*.
94+
2. Select **Networking** and then select **Application Gateway** in the **Featured** list.
8995
90-
4. Click **OK**.
91-
5. Select **DS1_V2** for the size of the virtual machine, and click **Select**.
92-
6. Make sure that **myVNet** is selected for the virtual network and the subnet is **myBackendSubnet**.
93-
7. Click **Disabled** to disable boot diagnostics.
94-
8. Click **OK**, review the settings on the summary page, and then click **Create**.
96+
### Basics tab
9597
96-
### Install IIS
98+
1. On the **Basics** tab, enter these values for the following application gateway settings:
9799
98-
1. Open the interactive shell and make sure that it is set to **PowerShell**.
100+
- **Resource group**: Select **myResourceGroupAG** for the resource group. If it doesn't exist, select **Create new** to create it.
101+
- **Application gateway name**: Enter *myAppGateway* for the name of the application gateway.
102+
- **Region** - Select **(US) East US**.
99103
100-
![Install custom extension](./media/application-gateway-create-url-route-portal/application-gateway-extension.png)
104+
![Create new application gateway: Basics](./media/application-gateway-create-gateway-portal/application-gateway-create-basics.png)
101105
102-
2. Run the following command to install IIS on the virtual machine:
106+
2. Under **Configure virtual network**, select **myVNet** for the name of the virtual network.
107+
3. Select **myAGSubnet** for the subnet.
108+
3. Accept the default values for the other settings and then select **Next: Frontends**.
103109
104-
```azurepowershell-interactive
105-
$publicSettings = @{ "fileUris" = (,"https://raw.githubusercontent.com/Azure/azure-docs-powershell-samples/master/application-gateway/iis/appgatewayurl.ps1"); "commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File appgatewayurl.ps1" }
106-
Set-AzVMExtension `
107-
-ResourceGroupName myResourceGroupAG `
108-
-Location eastus `
109-
-ExtensionName IIS `
110-
-VMName myVM1 `
111-
-Publisher Microsoft.Compute `
112-
-ExtensionType CustomScriptExtension `
113-
-TypeHandlerVersion 1.4 `
114-
-Settings $publicSettings
115-
```
110+
### Frontends tab
116111
117-
3. Create two more virtual machines and install IIS using the steps that you just finished. Enter the names of *myVM2* and *myVM3* for the names and for the values of VMName in Set-AzVMExtension.
112+
1. On the **Frontends** tab, verify **Frontend IP address type** is set to **Public**.
113+
114+
You can configure the Frontend IP to be Public or Private as per your use case. In this example, you'll choose a Public Frontend IP.
115+
> [!NOTE]
116+
> For the Application Gateway v2 SKU, you can only choose **Public** frontend IP configuration. Private frontend IP configuration is currently not enabled for this v2 SKU.
117+
118+
2. Choose **Create new** for the **Public IP address** and enter *myAGPublicIPAddress* for the public IP address name, and then select **OK**.
119+
120+
![Create new application gateway: frontends](./media/application-gateway-create-gateway-portal/application-gateway-create-frontends.png)
118121
119-
## Create backend pools with the virtual machines
122+
3. Select **Next: Backends**.
120123
121-
1. Click **All resources** and then click **myAppGateway**.
122-
2. Click **Backend pools**. A default pool was automatically created with the application gateway. Click **appGatewayBackendPool**.
123-
3. Click **Add target** to add *myVM1* to appGatewayBackendPool.
124+
### Backends tab
124125
125-
![Add backend servers](./media/application-gateway-create-url-route-portal/application-gateway-backend.png)
126+
The backend pool is used to route requests to the backend servers that serve the request. Backend pools can be composed of NICs, virtual machine scale sets, public IPs, internal IPs, fully qualified domain names (FQDN), and multi-tenant back-ends like Azure App Service.
126127
127-
4. Click **Save**.
128-
5. Click **Backend pools** and then click **Add**.
129-
6. Enter a name of *imagesBackendPool* and add *myVM2* using **Add target**.
130-
7. Click **OK**.
131-
8. Click **Add** again to add another backend pool with a name of *videoBackendPool* and add *myVM3* to it.
128+
1. On the **Backends** tab, select **+Add a backend pool**.
132129
133-
## Create a backend listener
130+
2. In the **Add a backend pool** window that opens, enter the following values to create an empty backend pool:
134131
135-
1. Click **Listeners** and the click **Basic**.
136-
2. Enter *myBackendListener* for the name, *myFrontendPort* for the name of the frontend port, and then *8080* as the port for the listener.
137-
3. Click **OK**.
132+
- **Name**: Enter *myBackendPool* for the name of the backend pool.
133+
3. Under **Backend Targets**, select **Virtual machine** from the drop-down list.
138134
139-
## Create a path-based routing rule
135+
5. Under **Target** select the network interface for **myVM1**
136+
6. Repeat to add an *Images* backend pool with *myVM2* as the target, and a *Video* backend pool with *myVM3* as the target.
137+
3. Select **Add** to save the backend pool configuration and return to the **Backends** tab.
140138
141-
1. Click **Rules** and then click **Path-based**.
142-
2. Enter *rule2* for the name.
143-
3. Enter *Images* for the name of the first path. Enter */images/*\* for the path. Select **imagesBackendPool** for the backend pool.
144-
4. Enter *Video* for the name of the second path. Enter */video/*\* for the path. Select **videoBackendPool** for the backend pool.
139+
4. On the **Backends** tab, select **Next: Configuration**.
145140
146-
![Create a path-based rule](./media/application-gateway-create-url-route-portal/application-gateway-route-rule.png)
141+
### Configuration tab
142+
143+
On the **Configuration** tab, you'll connect the frontend and backend pool you created using a routing rule.
144+
145+
1. Select **Add a rule** in the **Routing rules** column.
146+
147+
2. In the **Add a routing rule** window that opens, enter *myRoutingRule* for the **Rule name**.
148+
149+
3. A routing rule requires a listener. On the **Listener** tab within the **Add a routing rule** window, enter the following values for the listener:
150+
151+
- **Listener name**: Enter *myListener* for the name of the listener.
152+
- **Frontend IP**: Select **Public** to choose the public IP you created for the frontend.
153+
- **Port**: Type *8080*
154+
155+
Accept the default values for the other settings on the **Listener** tab, then select the **Backend targets** tab to configure the rest of the routing rule.
156+
157+
![Create new application gateway: listener](./media/application-gateway-create-gateway-portal/application-gateway-create-rule-listener.png)
158+
159+
4. On the **Backend targets** tab, select **myBackendPool** for the **Backend target**.
160+
161+
5. For the **HTTP setting**, select **Create new** to create a new HTTP setting. The HTTP setting will determine the behavior of the routing rule.
162+
163+
6. In the **Add an HTTP setting** window that opens, enter *myHTTPSetting* for the **HTTP setting name**. Accept the default values for the other settings in the **Add an HTTP setting** window, then select **Add** to return to the **Add a routing rule** window.
164+
165+
![Create new application gateway: HTTP setting](./media/application-gateway-create-gateway-portal/application-gateway-create-httpsetting.png)
166+
167+
7. Under **Path-based routing**, select **Add multiple targets to create a path-based rule**.
168+
8. For **Path**, type */images/*\*.
169+
9. For **Path rule name**, type *Images*.
170+
10. For **HTTP setting**, select **myHTTPSetting**
171+
11. For **Backend target**, select **Images**.
172+
12. Select **Add** to save the path rule and return to the **Add a routing rule** tab.
173+
13. Repeat to add a another rule for Video.
174+
14. Select **Add** to add the routing rule and return to the **Configuration** tab.
175+
15. Select **Next: Tags** and then **Next: Review + create**.
176+
177+
> [!NOTE]
178+
> You do not need to add a custom */** path rule to handle default cases. This is automatically handled by the default backend pool.
179+
180+
### Review + create tab
181+
182+
Review the settings on the **Review + create** tab, and then select **Create** to create the virtual network, the public IP address, and the application gateway. It may take several minutes for Azure to create the application gateway. Wait until the deployment finishes successfully before moving on to the next section.
147183
148-
5. Click **OK**.
149184
150185
## Test the application gateway
151186
152-
1. Click **All resources**, and then click **myAGPublicIPAddress**.
187+
1. Select **All resources**, and then select **myAppGateway**.
153188
154189
![Record application gateway public IP address](./media/application-gateway-create-url-route-portal/application-gateway-record-ag-address.png)
155190
156-
2. Copy the public IP address, and then paste it into the address bar of your browser. Such as, http:\//40.121.222.19.
191+
2. Copy the public IP address, and then paste it into the address bar of your browser. Such as, http:\//52.188.72.175:8080.
157192
158193
![Test base URL in application gateway](./media/application-gateway-create-url-route-portal/application-gateway-iistest.png)
159194
160-
3. Change the URL to http://<ip-address>:8080/images/test.htm, substituting <ip-address> with your IP address, and you should see something like the following example:
195+
The listener on port 8080 routes this request to the default backend pool.
196+
197+
3. Change the URL to *http://<ip-address>:8080/images/test.htm*, substituting <ip-address> with your IP address, and you should see something like the following example:
161198
162199
![Test images URL in application gateway](./media/application-gateway-create-url-route-portal/application-gateway-iistest-images.png)
163200
164-
4. Change the URL to http://<ip-address>:8080/video/test.htm, substituting <ip-address> with your IP address, and you should see something like the following example:
201+
The listener on port 8080 routes this request to the *Images* backend pool.
202+
203+
4. Change the URL to *http://<ip-address>:8080/video/test.htm*, substituting <ip-address> with your IP address, and you should see something like the following example:
165204
166205
![Test video URL in application gateway](./media/application-gateway-create-url-route-portal/application-gateway-iistest-video.png)
167206
168-
## Next steps
207+
The listener on port 8080 routes this request to the *Video* backend pool.
169208
170-
In this article, you learned how to
171209
172-
> [!div class="checklist"]
173-
> * Create an application gateway
174-
> * Create virtual machines for backend servers
175-
> * Create backend pools with the backend servers
176-
> * Create a backend listener
177-
> * Create a path-based routing rule
210+
## Next steps
178211
179-
To learn more about application gateways and their associated resources, continue to the how-to articles.
212+
- [Enabling end to end SSL on Azure Application Gateway](application-gateway-backend-ssl.md)

0 commit comments

Comments
 (0)
Please sign in to comment.