Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Azure icon
Labs

Create and Peer an Application Virtual Network

Welcome to the Create and Peer an Application Virtual Network lab. In this lab, we will cover three objectives: 1. Create an Application VNet using the VNet module 2. Peer the Application VNet with the Hub VNet 3. Confirm traffic flow between VNets By the end of this lab, you will have successfully created an Azure virtual network using the VNet module from the public registry and peered the virtual network with another virtual network in the same subscription.

Azure icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 30m
Published
Clock icon May 02, 2024

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create an Application VNet using the VNet module

    In this objective, you will create an application virtual network using the VNet module and the resource group provided by the lab. The network should use the 10.42.0.0/16 address space, and the web and app subnets should both use 24-bit subnets from that address space.

    1. Log into the Azure CLI using the lab credentials
    2. Retrieve the name of the resource group used for this lab:
    az group list --query [].name
    
    1. Create a Terraform configuration using the azurerm provider: provider.tf
    provider "azurerm" {
      features {}
      skip_provider_registration = true
    }
    
    1. Configure the lab provided resource group as a data source: main.tf
    data "azurerm_resource_group" "main" {
      name = var.resource_group_name
    }
    
    1. Use the VNet module to create a virtual network with two subnets. Create and add additional input variables and Terraform files as needed.
    2. Deploy the virtual network to Azure using Terraform
  2. Challenge

    Peer the Application VNet with the shared VNet

    In this objective, you will peer the application virtual network you created in the previous objective with the existing Hub virtual network generated by the lab. The peering should not provide gateway transit or forwarded traffic.

    1. Retrieve the name of the Hub virtual network:
    az network vnet list --query [].name
    
    1. Add a azurerm_virtual_network data source to your configuration
    2. Create azurerm_virtual_network_peering resources for each direction of the peering connection
    3. Apply the updated configuration to your environment
  3. Challenge

    Confirm traffic flow between VNets

    1. Check on the peering connections from the command line:
    az network vnet peering list --resource-group RESOURCE_GROUP_NAME --vnet-name HUB_VNET_NAME
    az network vnet peering list --resource-group RESOURCE_GROUP_NAME --vnet-name APP_VNET_NAME
    
    1. Log into the Azure portal and visually confirm peering connectivity

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans