Creating and connecting a virtual machine (VM) on Azure is a straightforward process when broken down into manageable steps. This comprehensive guide will take you through each step, ensuring you have all the information you need to get your VM up and running.
Step 1: Create a Free Trial Account on Azure
Begin by creating a free trial account on Azure. This account provides you with a subscription and $200 in Azure credits, which is more than enough to complete this tutorial and explore additional Azure services. Visit the Azure free trial page and follow the prompts to set up your account.
Step 2: Log in to Your Azure Account
Once your account is set up, navigate to the Azure portal at portal.azure.com. Enter your login credentials, which include your username and password, to access the portal's dashboard. The Azure portal is the central hub where you can manage all your Azure resources and services.
Step 3: Access the Virtual Machines Section
In the Azure portal, locate the "Search resources, services, and docs" field at the top of the page. Type "virtual machines" into the search bar.
You can also find the Virtual Machines option by clicking on the "hamburger" icon (three horizontal lines) in the top-left corner and scrolling through the menu, or by clicking on the "Create a resource" button and typing "virtual machine."
Step 4: Select the Virtual Machine Option
From the list of search results, click on the "Virtual Machines" option. This will take you to the Virtual Machines dashboard, where you can see any existing VMs and start the process of creating a new one.
Step 5: Click the “Create” Button
To begin the creation process, click the “Create” button. There are two "Create" buttons available; choose the one labeled "Create a virtual machine hosted by Azure." This will open a new form where you can enter the details for your new VM.
Step 6: Enter Project Details
In the project details section, you will need to select your subscription and create a resource group.
A resource group is a logical container that holds related resources for an Azure solution. Click on the "Create new" button to set up a new resource group, and give it a meaningful name that will help you identify it later.
Step 7: Configure Virtual Machine Settings
Next, you will need to provide details about the VM you are creating. This includes:
Name: Give your VM a unique and descriptive name.
Region: Choose the Azure region closest to your location to ensure optimal performance.
Image: Select the operating system for your VM. Common options include Ubuntu Server 20.04 LTS and Windows Server 2019 Datacenter.
Size: Choose the size of your VM based on your needs. The size determines the VM's CPU, memory, and storage capacity.
Step 8: Create an Administrator Account
Set up an administrator account for your VM. You will need to choose an authentication type (password or SSH key). For simplicity, select "Password." Enter a username, such as "AzureUser," and a strong password. This account will be used to access and manage your VM.
Step 9: Configure Inbound Port Rules
To allow remote access to your VM, configure the inbound port rules. If you are creating a Linux VM, select SSH (port 22). For a Windows VM, select RDP (port 3389) and HTTP (Port 80). This configuration allows you to connect to your VM from your local machine.
Step 10: Review Licensing
Ensure that you have checked the licensing terms and conditions. By default, this box is unchecked. Click the box to acknowledge and accept the licensing terms for the chosen operating system.
Step 11: Disable Boot Diagnostics
In the "Monitoring" tab, locate the boot diagnostics option and click "Disable." This step is optional but can simplify the setup process for basic VM configurations.
Step 12: Review and Create
Click the "Review + Create" button. Azure will validate your configuration. If validation passes, click "Create" to start the deployment. If there are any issues, address the recommendations and try again. The deployment process typically takes 3-5 minutes.
(Optional) An important option to consider is the use of tags, which are crucial for organizing billing data. Tags can be utilized to group usage by cost center, especially if you are running multiple VMs for different organizations. Additionally, you can use tags to categorize costs by runtime environment, such as identifying the billing usage for VMs running in the production environment. Here, I will name the tag.
Step 13: Verify VM Status
Once the deployment is complete, navigate to the Virtual Machines dashboard and check the status of your VM. If the VM status is "Running," the deployment was successful.
Step 14: Connect to Your Virtual Machine
First, it's advisable to click on the public IP address and adjust the Idle timeout to the max (30 minutes), save after this step and close.
To connect to your VM, click on the "Connect" button in the VM blade within the Azure portal. For Windows VMs, choose "RDP" and for Linux VMs, choose "SSH."
Step 15: Download the Connection File
Wait for the Public IP to be configured, once validated and configured for a Windows VM, click "Download RDP File." Open the downloaded RDP file on your local computer and click "Connect."
For a Linux VM, follow the provided SSH connection instructions.
Step 16: Enter Administrator Credentials
When prompted, enter the administrator username and password that you created during the VM setup process. Click "OK" or "Connect" to proceed.
Step 17: Complete the Connection
Follow any additional prompts to complete the connection. You may need to accept a certificate warning. Click "Yes" or "Continue" as needed.
Step 18: Start Using Your Virtual Machine
Once connected, you can begin using your VM as needed. For a Windows VM, you will have a full desktop environment. For a Linux VM, you will have terminal access.
By following these steps, you can efficiently create and connect to a virtual machine on Azure, leveraging the power and flexibility of Azure's cloud infrastructure.
Top comments (0)