0
0
Azurecloud~10 mins

Azure Load Balancer (Layer 4) - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the type of Azure Load Balancer that operates at Layer 4.

Azure
load_balancer = azure.network.LoadBalancer(location="eastus", sku=azure.network.LoadBalancerSku(name="[1]"))
Drag options to blanks, or click blank then click option'
ATrafficManager
BApplicationGateway
CWebApplicationFirewall
DStandard
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing ApplicationGateway which is Layer 7 load balancer.
Selecting TrafficManager which is DNS-based routing.
2fill in blank
medium

Complete the code to define the frontend IP configuration for the Azure Load Balancer.

Azure
frontend_ip_config = azure.network.FrontendIPConfiguration(name="LoadBalancerFrontEnd", subnet=azure.network.Subnet(id="[1]"))
Drag options to blanks, or click blank then click option'
A/subscriptions/xxx/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1
B/subscriptions/xxx/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1
C/subscriptions/xxx/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1
D/subscriptions/xxx/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a VM or public IP resource ID instead of a subnet ID.
Confusing storage account resource ID with subnet.
3fill in blank
hard

Fix the error in the backend pool definition by selecting the correct resource type for backend IP addresses.

Azure
backend_address_pool = azure.network.BackendAddressPool(name="BackendPool", backend_addresses=[[1]])
Drag options to blanks, or click blank then click option'
Aazure.network.NetworkInterface(ip_configurations=[ip_config])
Bazure.compute.VirtualMachine(id="vm1")
Cazure.network.PublicIPAddress(id="pip1")
Dazure.storage.BlobContainer(name="container1")
Attempts:
3 left
💡 Hint
Common Mistakes
Using VirtualMachine or PublicIPAddress objects directly in backend pool.
Confusing storage resources with network resources.
4fill in blank
hard

Fill both blanks to configure a health probe and load balancing rule for the Azure Load Balancer.

Azure
health_probe = azure.network.Probe(protocol="[1]", port=80, interval_in_seconds=15, number_of_probes=2)
load_balancing_rule = azure.network.LoadBalancingRule(protocol="[2]", frontend_port=80, backend_port=80, probe=health_probe)
Drag options to blanks, or click blank then click option'
ATcp
BHttp
CUdp
DHttps
Attempts:
3 left
💡 Hint
Common Mistakes
Using HTTP or HTTPS protocols which are Layer 7.
Confusing UDP with TCP for health probes.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps backend pool names to their respective IP configurations filtered by a specific port.

Azure
backend_ip_map = {pool.name: [ip_config[1] for ip_config in pool.ip_configurations if ip_config.port [2] [3]] for pool in backend_pools}
Drag options to blanks, or click blank then click option'
A.private_ip_address
B==
C80
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' in the filter condition.
Accessing wrong attribute instead of private_ip_address.