Create an Azure Virtual Network (VNet)
Tags: virtualnet, azure, tutorial, cloudcomputing
Published: 2024-07-13 04:18:05

Contents <a name="content"></a>
[Overview of Azure Virtual Network](#overview)
[Steps to Creating Azure Virtual Network
] (#create vnet)
### Overview of Azure Virtual Network <a name="overview"></a>

Azure Virtual Network (VNet) is a versatile and powerful service that provides flexibility, security, and scalability required to support a wide range of applications and workloads in the cloud. It enable users to securely connect Azure resources to each other, to the internet, and to on-premises networks. It serves as the backbone for networking within the Azure ecosystem, offering a range of features and capabilities that facilitate secure and efficient communication.

##### Key Features and Capabilities
- Isolation and Segmentation: VNets provide logical isolation within the Azure environment, allowing users to create multiple isolated networks. Each VNet is isolated from other VNets, providing a secure environment for deploying resources.

- Subnets: A subnet or subnetwork is a network inside a network. VNets can be divided into subnets to enable better organization and management of resources. Subnets can also be used to apply network security policies and route network traffic.

- Network Security Groups (NSGs): NSGs allow users to control inbound and outbound traffic to and from network interfaces, VMs, and subnets. They act as virtual firewalls, providing granular control over network traffic.
- Azure Firewall: A managed, cloud-based network security service that protects Azure Virtual Network resources. It allows users to define, enforce, and log application and network connectivity policies.

- VPN Gateway: This service enables secure cross-premises connectivity between the VNet and on-premises infrastructure through a secure VPN tunnel. It supports both site-to-site and point-to-site configurations.

- ExpressRoute: Provides a dedicated, private connection between Azure datacenters and on-premises infrastructure or colocation environments. It offers higher security, reliability, and faster speeds compared to typical internet connections.

- Peering: VNet peering allows VNets to communicate with each other directly through the Azure backbone network, enabling low-latency, high-bandwidth connectivity between VNets in the same region or across regions.
- Load Balancing: Azure Load Balancer and Application Gateway provide scalable and high-availability network services. They distribute incoming network traffic across multiple servers to ensure reliability and optimal performance.

- DNS Services: Azure DNS hosts domain names and resolves DNS queries using Microsoft’s global network of name servers, ensuring high performance and availability.

- DDoS Protection: Azure DDoS Protection safeguards applications by scrubbing traffic at the Azure network edge before it can affect service availability.

#####Use Cases
- Hybrid Cloud Deployments: Securely extend on-premises networks to Azure, enabling a hybrid cloud environment that leverages the benefits of both on-premises and cloud resources.
- Multi-Tier Applications: Deploy multi-tier applications with isolated network environments for different tiers (e.g., web, application, and database tiers) to enhance security and manageability.

- Disaster Recovery: Utilize VNets for disaster recovery setups, ensuring that critical applications and data can be quickly recovered in the event of a failure.

- Big Data and Analytics: Deploy big data and analytics solutions, connecting various services and resources securely within the VNet for efficient data processing and analysis.

[back to top](#content)

### Steps to Creating Azure Virtual Network <a name="create vnet"></a>
This guide will create an Azure virtual network with four subnets using the address space 192.148.30.0/26 for company XYZ. The  four chosen subnets represent four departments in the company which are ICT, Sales, Audit, and Account. Below is a step-by-step guide:

##### Step 1: Log in to the Azure Portal

- On your web browser, type portal.azure.com to go to the Azure Portal login page.

- Log in with your Azure account credentials or click [here](https://azure.microsoft.com/en-us/free) to create a free one if you do not have an account yet.

##### Step 2: Create a Virtual Network

- On the Azure Portal search bar, type Virtual Network and select Virtual Network from the list.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gko2eqserexigdzdtrri.jpg)
- click Create.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tk4ao8yotpfvir2ltmx7.jpg)

##### Step 3: Configure the Virtual Network Basics
In the Basics tab, fill in the following details:
- Subscription: Select the subscription to use.

- Resource group: Create a new resource group or select an existing one.
- Name: Enter a name for the VNet (example: XYZ-VNet).
- Region: Select the region where you want to create the VNet.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ng1m3qbd0txvy9nn559f.jpg)

##### Step 4: Configure the Address Space
- Click on the IP Addresses tab.
- Under IPv4 address space, 
- Enter 192.148.30.0 in the Address space field and select /26 on the CIDR field then delete the default subnet created and add your subnets.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4x6clqe63fusajobjs0.jpg)

##### Step 5: Add Subnets
add four subnets for ICT, Sale, Audit and Account department
**For ICT Subnet:**
Under the Subnets section of the address space, 
1. click on + Add subnet. 
On the Add subnet screen,
2. enter or select values for the subnet settings. Enter the following details for example:
- Subnet name: ICT
- Starting address: 192.148.30.0
- size: select /28
- Click Add 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kv93w0z55b16psnfk4fn.jpg)

**For sales Subnet:**
- click on + Add subnet
- Subnet name: sales
- starting address: 192.148.30.16
- Size:/28
- Click Add 
Do the same for the other two subnets with the following details:

**For Audit Subnet:**
- Subnet name: Audit
- starting address: 192.148.30.32
- Size:/28
- Click Add 

**For account Subnet:**
Subnet name: Account
- starting address : 192.148.30.48
- Size:/28
- Click Add 

##### Step 6: Review and Create the VNet
Once all subnets are added, 
- click on the Review + create button at the bottom of the page.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbvfy6r4s0dtq2w5m7kb.jpg)
- Review the settings to ensure everything is configured correctly.
- Click Create to deploy the Virtual Network.

##### Step 7: Verify the Deployment
- After the deployment is complete, click Go to resource to see the overview.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/65mjqvg2nl5zbnifxv1k.jpg)

Ensure that the subnets are created with the correct address ranges.

- On the left pane, click setting

- select subnets

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8d563w6s8la87h1uyx9j.jpg)

_By the way, if this is for practice only, endeavor to delete the virtual network after creating to avoid unnecessary costs._
[back to top](#content)