Skip to content

Commit 4f3ebaf

Browse files
committed
Enhance Application Gateway URL redirect PowerShell tutorial
- Updated to use Application Gateway v2 (Standard_v2 SKU) for improved performance - Added zone redundancy and static IP configuration for high availability - Upgraded to Windows Server 2022 and modern VM sizes (Standard_D2s_v3) - Enhanced PowerShell scripts with better error handling and validation - Added comprehensive monitoring and troubleshooting sections - Included production-ready security best practices - Updated Azure PowerShell module requirements to version 5.4.1 - Added detailed architecture explanations and technical depth - Improved code comments and variable consistency - Added diagnostic logging and performance monitoring guidance - Updated date to July 9, 2025
1 parent 94c1117 commit 4f3ebaf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

articles/application-gateway/tutorial-url-redirect-powershell.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,15 @@ Write-Output "Preserves: Path and Query String"
372372

373373
### Add the redirection URL path map
374374

375+
Create a separate URL path map for redirection scenarios. This map will handle traffic on port 8081 and redirect specific paths to the appropriate listener on port 8080.
376+
375377
```azurepowershell-interactive
378+
# Get the current Application Gateway configuration
376379
$appgw = Get-AzApplicationGateway `
377-
-ResourceGroupName myResourceGroupAG `
380+
-ResourceGroupName $resourceGroupName `
378381
-Name myAppGateway
379382
383+
# Get references to existing configurations
380384
$poolSettings = Get-AzApplicationGatewayBackendHttpSettings `
381385
-ApplicationGateway $appgw `
382386
-Name myPoolSettings
@@ -389,19 +393,25 @@ $redirectConfig = Get-AzApplicationGatewayRedirectConfiguration `
389393
-ApplicationGateway $appgw `
390394
-Name redirectConfig
391395
396+
# Create path rule for redirection - images traffic will be redirected
392397
$redirectPathRule = New-AzApplicationGatewayPathRuleConfig `
393398
-Name redirectPathRule `
394399
-Paths "/images/*" `
395400
-RedirectConfiguration $redirectConfig
396401
402+
# Add redirection path map configuration
397403
Add-AzApplicationGatewayUrlPathMapConfig `
398404
-ApplicationGateway $appgw `
399405
-Name redirectpathmap `
400406
-PathRules $redirectPathRule `
401407
-DefaultBackendAddressPool $defaultPool `
402408
-DefaultBackendHttpSettings $poolSettings
403409
410+
# Apply the configuration changes
404411
Set-AzApplicationGateway -ApplicationGateway $appgw
412+
413+
Write-Output "Redirection URL path map added successfully"
414+
Write-Output "Redirection rule: /images/* on port 8081 -> port 8080"
405415
```
406416

407417
### Add routing rules

0 commit comments

Comments
 (0)