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
# Create an application gateway with URL path-based redirection using Azure PowerShell
15
15
16
-
main
16
+
17
17
You can use Azure PowerShell to configure [URL-based routing rules](./url-route-overview.md) when you create an [application gateway](./overview.md). In this tutorial, you create backend pools using [virtual machine scale sets](/azure/virtual-machine-scale-sets/overview). You then create URL routing rules that redirect web traffic to the appropriate backend pool based on the request URL path.
18
18
You can use Azure PowerShell to configure advanced [URL-based routing rules](./url-route-overview.md) when you create an [application gateway](./overview.md).
19
19
20
20
This tutorial covers production-ready configurations including security best practices, performance optimization, and monitoring setup.
21
-
main
21
+
22
22
23
23
In this tutorial, you learn how to:
24
24
@@ -68,14 +68,14 @@ Write-Output "Resource group '$resourceGroupName' created successfully in '$loca
68
68
69
69
## Create network resources
70
70
71
-
main
71
+
72
72
Create the subnet configurations for *myBackendSubnet* and *myAGSubnet* using [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig). Create the virtual network named *myVNet* using [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) with the subnet configurations. Finally, create the public IP address named *myAGPublicIPAddress* using [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress). These resources provide network connectivity to the application gateway and its associated resources.
73
73
74
74
> [!IMPORTANT]
75
75
> The application gateway subnet (*myAGSubnet*) can contain only application gateways. No other resources are allowed in this subnet.
76
76
Create the subnet configurations for *myBackendSubnet* and *myAGSubnet* using [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig). The Application Gateway requires a dedicated subnet with minimum /24 CIDR for proper operation and future scaling. Create the virtual network named *myVNet* using [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) with the subnet configurations. Finally, create the public IP address with Standard SKU and static allocation for improved security and performance using [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress).
77
77
78
-
main
78
+
79
79
80
80
```azurepowershell-interactive
81
81
# Create backend subnet configuration with appropriate CIDR for scale sets
In this example, you create three virtual machine scale sets that support the three backend pools that you created. The scale sets are named *myvmss1*, *myvmss2*, and *myvmss3*. Each scale set contains two virtual machine instances on which you install IIS. You assign the scale set to the backend pool when you configure the IP settings.
471
471
472
-
main
472
+
473
473
> [!IMPORTANT]
474
474
> Replace `<username>` and `<password>` with your own values before running the script. Use a strong password that meets Azure's security requirements.
475
475
**Security Note**: Replace `<username>` and `<password>` with secure credentials. Consider using Azure Key Vault for credential management in production scenarios.
0 commit comments