Deploy a Virtual Machine into an Existing Subnet

This guide walks you through the process of deploying a new Azure Virtual Machine (VM) into a pre-existing subnet within your Azure Virtual Network (VNet).

Prerequisites:
  • An existing Azure Virtual Network (VNet)
  • At least one subnet configured within the VNet.
  • An Azure subscription with permissions to create resources.

Steps to Deploy a VM into a Subnet

1

Navigate to the Azure Portal: Open your web browser and go to https://portal.azure.com/. Sign in with your Azure account credentials.

2

Create a Virtual Machine: On the Azure portal dashboard, click on "Create a resource". Search for "Virtual machine" and select it. Click "Create".

Azure Portal Create VM

Figure 1: Creating a Virtual Machine in Azure Portal.

3

Configure Basic Settings: Fill in the required fields for your VM, such as subscription, resource group, VM name, region, availability options, and security type.

4

Select Image and Size: Choose the operating system image (e.g., Windows Server, Ubuntu) and the VM size that best suits your needs.

5

Configure Administrator Account: Set up the administrator username and password (or SSH public key for Linux VMs).

6

Configure Networking: This is the crucial step for deploying into a specific subnet. Navigate to the "Networking" tab.

  • Ensure "Public inbound access" is configured as required (e.g., "Allow selected ports" and choose ports like RDP or SSH).
  • Under "Virtual network", select your existing VNet.
  • In the "Subnet" dropdown, choose the specific subnet you want to deploy the VM into.
  • You can configure other networking options like Public IP, Load balancing, and Network Security Group as needed. For new deployments, an NSG is automatically created or you can select an existing one.
Azure VM Networking Configuration

Figure 2: Networking tab for VM deployment, highlighting subnet selection.

7

Configure Disks, Management, and Advanced Settings: Review and configure options for disks, monitoring, management, and advanced features as per your requirements.

8

Review and Create: Click on the "Review + create" button. Azure will validate your VM configuration. Once validation passes, click "Create" to begin the deployment process.

Tip: Ensure that the subnet you select has available IP addresses. If the subnet is full, the VM deployment will fail. You can check subnet capacity in the Virtual Network settings.

Verifying the Deployment

Once the deployment is complete, you can navigate to the newly created VM resource in the Azure portal. Under the "Overview" blade, you will see the network details, including the VNet and subnet the VM is connected to.