Introduction
As part of my Azure Administrator certification journey, I recently completed Lab 06 - Implement Traffic Management, which focused on configuring and testing both Azure Load Balancer and Azure Application Gateway.
In this lab, I learned how to effectively distribute incoming traffic across multiple virtual machines (VMs), optimize performance, and implement path-based routing for more specific traffic management. This is an essential skill for ensuring that applications are highly available and resilient to traffic spikes.
Lab Overview
The goal of this lab was to set up Azure Load Balancer to distribute traffic across multiple VMs and implement Azure Application Gateway for HTTP/S traffic management, with path-based routing. I learned how to configure both services in the same virtual network to distribute traffic and direct different types of traffic (images vs. videos) to different VMs, based on the request path. These services enable optimized traffic management and improve application availability by load balancing traffic across multiple backend servers.
Skills Practiced:
✅ Deploying and configuring Azure Load Balancer
✅ Deploying and configuring Azure Application Gateway
✅ Implementing path-based routing for web traffic
✅ Monitoring backend health for traffic management
✅ Testing and verifying the load balancer and application gateway
Task 1: Use a Template to Provision an Infrastructure
The first task was to use a custom template to deploy a virtual network, network security group, and virtual machines. Here’s what I did:
1️⃣ Downloaded the provided template and parameters files.
2️⃣ In the Azure portal, selected Deploy a custom template and uploaded the files.
3️⃣ Configured the deployment settings and created a new resource group for the resources.
4️⃣ Waited for the deployment to complete, which took about 5 minutes.
📌 Insight:
Using templates to deploy infrastructure ensures consistency and reduces the chances of configuration errors. It also saves time when provisioning multiple resources with similar settings.
Task 2: Configure an Azure Load Balancer
Next, I configured an Azure Load Balancer to distribute traffic between two VMs in the same virtual network. Here’s what I did:
1️⃣ Created a Public Load Balancer with a frontend IP configuration, selecting a static public IP address.
2️⃣ Created a Backend Pool with the two VMs and added load balancing rules to distribute traffic on port 80.
3️⃣ Created a health probe to monitor the status of the VMs in the backend pool.
4️⃣ Verified that the Load Balancer correctly distributed traffic between the VMs by refreshing the browser multiple times to see the "Hello World" messages from different VMs.
📌 Insight:
The Azure Load Balancer operates at Layer 4 (Transport Layer) and is best suited for distributing network traffic (TCP/UDP). It ensures high availability and load balancing of traffic to backend VMs.
Task 3: Configure an Azure Application Gateway
In this task, I deployed an Azure Application Gateway to handle Layer 7 (HTTP/S) traffic. The gateway supports path-based routing, which allows routing traffic based on URL paths. Here’s what I did:
1️⃣ Created a Subnet for the Application Gateway in the virtual network.
2️⃣ Deployed an Application Gateway and configured a public frontend IP address.
3️⃣ Set up backend pools for two VMs (one for images and the other for videos).
4️⃣ Created path-based routing rules to direct traffic from /image/* to the image VM and /video/* to the video VM.
5️⃣ Tested the configuration by accessing URLs like http:///image/ and http:///video/ to verify traffic was routed correctly.
📌 Insight:
Azure Application Gateway operates at Layer 7 (Application Layer) and supports advanced traffic management features such as SSL termination, Web Application Firewall (WAF), and path-based routing. It’s ideal for managing web traffic, especially for web applications that require traffic management based on URL paths.
Key Learnings
1️⃣ Azure Load Balancer
A Public Load Balancer distributes internet traffic to VMs and supports TCP/UDP traffic.
Backend Pools are used to define which VMs or resources receive the traffic, while Health Probes monitor the health of the VMs to ensure traffic is only sent to healthy instances.
Load balancing rules define how traffic is distributed across the backend pool.
2️⃣ Azure Application Gateway
The Application Gateway provides Layer 7 load balancing, which makes routing decisions based on HTTP request attributes, such as URI path or host headers.
Path-based routing allows the Application Gateway to direct traffic to different backend pools based on the URL path (e.g., /image/* for one pool and /video/* for another).
The WAF tier of the Application Gateway can be enabled to provide a Web Application Firewall, securing your web applications from threats.
3️⃣ Traffic Management Best Practices
Load Balancer: Use for scenarios where you need to balance TCP/UDP traffic and provide high availability for your virtual machines.
Application Gateway: Ideal for HTTP/S traffic where you need more control over routing based on URL paths and other HTTP attributes.
Session Persistence: With load balancing, you may need to configure session persistence if required by your application, to maintain session consistency across different requests.
4️⃣ Testing and Monitoring
Always test the configuration by accessing the frontend IP address and verifying that traffic is being distributed as expected.
Monitor the backend health of the resources to ensure that traffic is only sent to healthy resources.
Conclusion
Completing this lab gave me hands-on experience with configuring both Azure Load Balancer and Azure Application Gateway, two powerful tools for traffic management. Azure Load Balancer is perfect for distributing TCP/UDP traffic across backend VMs, while Azure Application Gateway excels at HTTP/S traffic with advanced routing capabilities, including path-based routing and SSL termination. These tools are essential for improving the availability, scalability, and performance of web applications.
🚀 Stay tuned for my next blog post on Lab 10 - Implement Data Protection!
🔗 Follow my journey as I continue mastering Azure Administration! 🚀
Top comments (0)