Unnecessary VNET ?

Amir Firouzi 40 Reputation points
2025-06-06T08:46:19.7+00:00

Hi,

I just performed this exercise but I think there is a mistake. in the instruction below VNET "Azure-VNet-1" is created with gateway subnet.

az network vnet subnet create \ 
--resource-group "[sandbox resource group name]" \ 
--vnet-name Azure-VNet-1 \ 
--address-prefixes 10.0.255.0/27 \ 
--name GatewaySubne

But in the next page another VNET named "VNG-Azure-VNet-1" is created again with gateway subnet and both of them are located in Azure-side.

az network vnet create \ 
--resource-group "[sandbox resource group name]" \ 
--name VNG-Azure-VNet-1 \ 
--subnet-name GatewaySubnet

And in the next step a VNET GW is created with the same name. "VNG-Azure-VNet-1".

az network vnet-gateway create 
--resource-group "[sandbox resource group name]" 
--name VNG-Azure-VNet-1 
--public-ip-addresses PIP-VNG-Azure-VNet-1 
--vnet VNG-Azure-VNet-1 
--gateway-type Vpn 
--vpn-type RouteBased 
--sku VpnGw1 
--no-wait

I believe second VNET creation is unnecessary. I also read this tutorial in which one VNET is created.

Could you please explain about this issue?

Thanks.

Azure | Azure Training
{count} votes

Accepted answer
  1. Hamid Sadeghpour Saleh 101 Reputation points MVP Volunteer Moderator
    2025-06-06T12:22:25.56+00:00

    Hi Amir,

    That's interesting. What you’re seeing is likely a redundancy or inconsistency in the lab instructions.

    Typically, only one VNet with a GatewaySubnet is needed to deploy a VPN Gateway.

    The first command creates a subnet named GatewaySubne (note the typo—it should be GatewaySubnet) inside the existing VNet Azure-VNet-1.

    The second command creates a new VNet named VNG-Azure-VNet-1 with its own GatewaySubnet.

    Then the VPN Gateway is created on this second VNet.

    In most real-world and tutorial scenarios, you just create one VNet with a properly named GatewaySubnet, then create the VPN Gateway inside it.

    The second VNet creation seems unnecessary unless the lab intends to demonstrate managing multiple VNets or a specific scenario involving multiple VNets.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.