Courseiva
Implement and Manage Virtual NetworkingmediumMultiple ChoiceObjective-mapped

AZ-104 Implement and Manage Virtual Networking Practice Question

A hub VNet already has a VPN gateway connected to on-premises. A spoke VNet in the same region must reach on-premises networks through that existing gateway, and you do not want to deploy a separate VPN gateway in the spoke. What peering settings should you use?

⚠ Common exam trap

Watch out — candidates often confuse which peering direction gets which setting: candidates often mistakenly enable 'Use remote gateways' on the hub side and 'Allow gateway transit' on the spoke side, which is the reverse of the correct configuration.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Enable Allow gateway transit on the hub peering and Use remote gateways on the spoke peering.

To enable a spoke VNet to use a hub VNet's VPN gateway for on-premises connectivity without deploying a separate gateway, you must configure the hub peering with 'Allow gateway transit' and the spoke peering with 'Use remote gateways'. This allows the spoke to route traffic through the hub's VPN gateway, leveraging the existing site-to-site VPN connection to on-premises.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create peering only; the spoke will automatically use the hub gateway without extra settings.

    Why it's wrong here

    VNet peering only establishes IP connectivity between the two virtual networks; it does not automatically enable the hub's VPN gateway for spoke use. Gateway transit is an explicit peering attribute that must be enabled on the hub peering and accepted on the spoke peering. Without setting Allow gateway transit on the hub side and Use remote gateways on the spoke side, Azure will not inject the hub gateway's routes into the spoke's effective route table, so traffic to on-premises will fail or be dropped.

    When this WOULD be correct

    This would be correct if the question stated that the hub VNet already has 'Allow gateway transit' enabled and the spoke VNet has 'Use remote gateways' enabled, and the candidate is asked what additional peering settings are needed—then the answer would be 'none, the settings are already in place'.

  • Enable Use remote gateways on the hub peering and Allow gateway transit on the spoke peering.

    Why it's wrong here

    These two peering flags have specific, non-interchangeable roles. The hub VNet that owns the VPN gateway must set Allow gateway transit on its peering side to expose the gateway to the peer, while the spoke VNet must set Use remote gateways on its peering side to consume that gateway. Reversing the settings means the hub never advertises the gateway as transitive and the spoke attempts to use a remote gateway that has not been offered; Azure also blocks the Use remote gateways setting when the remote side has not enabled Allow gateway transit.

    When this WOULD be correct

    This option would be correct if the question asked about enabling transit from the hub to the spoke (e.g., allowing the hub to use a gateway deployed in the spoke), or if the roles of hub and spoke were reversed in the peering definitions.

  • Enable Allow gateway transit on the hub peering and Use remote gateways on the spoke peering.

    Why this is correct

    In a hub-spoke design, the hub VNet that owns the VPN gateway must allow gateway transit, and the spoke must be configured to use the remote gateway. This lets the spoke route on-premises traffic through the hub without deploying its own gateway. The direction of these settings matters, and reversing them breaks the design.

  • Create a service endpoint from the spoke VNet to the on-premises network.

    Why it's wrong here

    Service endpoints are designed for private access to Azure PaaS services, such as Azure Storage or SQL Database, by adding the VNet's public IP prefix to the service's firewall. They cannot be configured for on-premises network address ranges and do not influence routing toward a VPN gateway or ExpressRoute circuit. Therefore, creating a service endpoint from the spoke to the on-premises network is not a valid operation and would have no effect on on-premises connectivity; the spoke still requires gateway transit or its own gateway to reach on-premises resources.

    When this WOULD be correct

    A question asks: 'You need to allow a VNet to securely access Azure Storage without using a public IP. What should you configure?' In that case, creating a service endpoint from the VNet to the Storage service is correct.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.

Enable Allow gateway transit on the hub peering and Use remote gateways on the spoke peering.Correct answer

Why this is correct

In a hub-spoke design, the hub VNet that owns the VPN gateway must allow gateway transit, and the spoke must be configured to use the remote gateway. This lets the spoke route on-premises traffic through the hub without deploying its own gateway. The direction of these settings matters, and reversing them breaks the design.

Create peering only; the spoke will automatically use the hub gateway without extra settings.Wrong answer — click to see why

Why this is wrong here

In Azure, a spoke VNet does not automatically use the hub's VPN gateway just by creating peering. You must explicitly configure gateway transit by enabling 'Allow gateway transit' on the hub peering and 'Use remote gateways' on the spoke peering.

★ When this WOULD be the correct answer

This would be correct if the question stated that the hub VNet already has 'Allow gateway transit' enabled and the spoke VNet has 'Use remote gateways' enabled, and the candidate is asked what additional peering settings are needed—then the answer would be 'none, the settings are already in place'.

Why candidates choose this

Candidates may assume that VNet peering automatically inherits gateway capabilities, similar to how on-premises networks might automatically route through a VPN gateway in a hub-and-spoke topology without explicit configuration.

Enable Use remote gateways on the hub peering and Allow gateway transit on the spoke peering.Wrong answer — click to see why

Why this is wrong here

The settings are reversed: 'Use remote gateways' must be enabled on the spoke peering (from spoke to hub), and 'Allow gateway transit' on the hub peering (from hub to spoke). Option B swaps these, which would not allow the spoke to use the hub's VPN gateway.

★ When this WOULD be the correct answer

This option would be correct if the question asked about enabling transit from the hub to the spoke (e.g., allowing the hub to use a gateway deployed in the spoke), or if the roles of hub and spoke were reversed in the peering definitions.

Why candidates choose this

Candidates often confuse which setting goes on which side of the peering, especially when terms like 'gateway transit' and 'remote gateways' sound similar, leading them to swap the configuration.

Create a service endpoint from the spoke VNet to the on-premises network.Wrong answer — click to see why

Why this is wrong here

Service endpoints are used for secure access to Azure services (like Storage or SQL) from a VNet, not for connecting to on-premises networks via VPN. They do not provide IP-level routing or gateway transit capabilities.

★ When this WOULD be the correct answer

A question asks: 'You need to allow a VNet to securely access Azure Storage without using a public IP. What should you configure?' In that case, creating a service endpoint from the VNet to the Storage service is correct.

Why candidates choose this

Candidates may confuse 'service endpoint' with 'VPN endpoint' or think any 'endpoint' can connect to on-premises, misunderstanding the scope of service endpoints.

Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

About these practice questions

This AZ-104 question is part of Courseiva's 1,049-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-104 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-104 exam.