Bird
Raised Fist0
Azurecloud~10 mins

VNet peering for connectivity in Azure - Interactive Code Practice

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

Complete the code to create a VNet peering from VNetA to VNetB.

Azure
az network vnet peering create --name VNetAtoVNetB --resource-group MyResourceGroup --vnet-name VNetA --remote-vnet [1] --allow-vnet-access
Drag options to blanks, or click blank then click option'
AVNetB
BVNetC
CVNetD
DVNetE
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong VNet name for the remote VNet.
Confusing the local VNet name with the remote VNet name.
2fill in blank
medium

Complete the code to allow forwarded traffic in the VNet peering.

Azure
az network vnet peering create --name VNetBtoVNetA --resource-group MyResourceGroup --vnet-name VNetB --remote-vnet VNetA --allow-vnet-access --allow-[1]-traffic
Drag options to blanks, or click blank then click option'
Aprivate
Bgateway
Cinternet
Dforwarded
Attempts:
3 left
💡 Hint
Common Mistakes
Using --allow-gateway-traffic instead of --allow-forwarded-traffic.
Confusing forwarded traffic with internet traffic.
3fill in blank
hard

Fix the error in the peering creation command by completing the missing parameter.

Azure
az network vnet peering create --name VNetAtoVNetB --resource-group MyResourceGroup --vnet-name VNetA --remote-vnet VNetB --allow-vnet-access --[1]-gateway-use
Drag options to blanks, or click blank then click option'
Adisable
Benable
Callow
Dblock
Attempts:
3 left
💡 Hint
Common Mistakes
Using --enable-gateway-use which is invalid.
Using --disable-gateway-use which disables the feature.
4fill in blank
hard

Fill both blanks to create a peering that allows gateway transit and forwarded traffic.

Azure
az network vnet peering create --name VNetBtoVNetA --resource-group MyResourceGroup --vnet-name VNetB --remote-vnet VNetA --allow-[1]-gateway-use --allow-[2]-traffic
Drag options to blanks, or click blank then click option'
Aallow
Bforwarded
Cinternet
Dblock
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'internet' or 'block' instead of 'forwarded' for traffic.
Using 'enable' instead of 'allow' for gateway use.
5fill in blank
hard

Fill all three blanks to update an existing peering to allow gateway transit, forwarded traffic, and remote VNet access.

Azure
az network vnet peering update --name VNetAtoVNetB --resource-group MyResourceGroup --vnet-name VNetA --set allow[1]gatewayUse=[2] allow[3]traffic=[4]
Drag options to blanks, or click blank then click option'
AGateway
BForwarded
CTrue
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'False' instead of 'True' to enable permissions.
Swapping 'Gateway' and 'Forwarded' in the wrong places.

Practice

(1/5)
1. What is the main purpose of Azure VNet peering?
easy
A. To connect two virtual networks for direct communication
B. To create a backup of virtual machines
C. To deploy applications faster
D. To monitor network traffic

Solution

  1. Step 1: Understand VNet peering concept

    VNet peering allows two virtual networks to communicate directly without going through the internet.
  2. Step 2: Identify the main use case

    This direct communication is the primary purpose, enabling resource sharing securely within Azure.
  3. Final Answer:

    To connect two virtual networks for direct communication -> Option A
  4. Quick Check:

    VNet peering = direct network connection [OK]
Hint: VNet peering links networks directly, not backups or monitoring [OK]
Common Mistakes:
  • Confusing peering with VM backup
  • Thinking peering speeds up app deployment
  • Assuming peering is for traffic monitoring
2. Which of the following is the correct way to create a VNet peering in Azure Portal?
easy
A. Create a new VNet with peering enabled by default
B. Create peering from one VNet only
C. Create peering from both VNets involved
D. Enable peering in the subscription settings

Solution

  1. Step 1: Review peering setup requirements

    VNet peering requires configuration from both virtual networks to allow full communication.
  2. Step 2: Identify correct procedure

    Creating peering from both VNets ensures bidirectional connectivity and proper routing.
  3. Final Answer:

    Create peering from both VNets involved -> Option C
  4. Quick Check:

    Peering setup = both sides configured [OK]
Hint: Peering needs setup on both VNets, not just one [OK]
Common Mistakes:
  • Configuring peering only on one VNet
  • Assuming peering is automatic on new VNets
  • Looking for peering in subscription settings
3. Given two VNets, VNetA and VNetB, peered correctly, what happens when a VM in VNetA tries to ping a VM in VNetB?
medium
A. The ping fails because VNets cannot communicate even if peered
B. The ping fails because peering blocks ICMP traffic
C. The ping succeeds only if both VMs are in the same subnet
D. The ping succeeds because peering allows direct communication

Solution

  1. Step 1: Understand VNet peering behavior

    Peering connects VNets so resources can communicate directly, including ping (ICMP) traffic if allowed by NSGs.
  2. Step 2: Analyze the ping scenario

    If no network security group blocks ICMP, ping from VM in VNetA to VM in VNetB will succeed due to peering.
  3. Final Answer:

    The ping succeeds because peering allows direct communication -> Option D
  4. Quick Check:

    Peering enables direct VM communication [OK]
Hint: Peering allows direct traffic unless blocked by security rules [OK]
Common Mistakes:
  • Assuming peering blocks ping by default
  • Thinking VMs must be in same subnet to communicate
  • Believing peering does not enable VNet communication
4. You created VNet peering from VNetA to VNetB but forgot to create peering from VNetB to VNetA. What is the result?
medium
A. Full bidirectional communication between VNets
B. Unidirectional communication from VNetA to VNetB only
C. No communication between VNets
D. Peering automatically completes from both sides

Solution

  1. Step 1: Understand peering directionality

    Peering must be created on both VNets for full bidirectional communication.
  2. Step 2: Analyze partial peering effect

    With peering only from VNetA to VNetB, traffic flows from A to B but not from B to A.
  3. Final Answer:

    Unidirectional communication from VNetA to VNetB only -> Option B
  4. Quick Check:

    One-sided peering = one-way traffic [OK]
Hint: Peering one side = one-way connection only [OK]
Common Mistakes:
  • Assuming peering is automatic both ways
  • Expecting no communication at all
  • Thinking peering creates full connection from one side
5. You have two VNets in different Azure regions and want to enable secure, low-latency communication between them. Which VNet peering type should you use?
hard
A. Global VNet peering
B. Local VNet peering
C. VPN Gateway peering
D. ExpressRoute peering

Solution

  1. Step 1: Identify peering types and their use cases

    Local VNet peering works within the same region; global VNet peering connects VNets across regions.
  2. Step 2: Choose peering for cross-region communication

    Global VNet peering enables secure, low-latency communication between VNets in different Azure regions.
  3. Final Answer:

    Global VNet peering -> Option A
  4. Quick Check:

    Cross-region VNet peering = global peering [OK]
Hint: Use global peering for cross-region VNet connection [OK]
Common Mistakes:
  • Choosing local peering for different regions
  • Confusing VPN Gateway with peering
  • Selecting ExpressRoute which is for on-premises
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard