Click here to Skip to main content
15,887,430 members
Articles / Hosted Services / Azure
Tip/Trick

Creating Azure Virtual Machines

Rate me:
Please Sign up or sign in to vote.
4.29/5 (6 votes)
1 Jun 2015CPOL4 min read 20.6K   8   3
This tip will help you to get a basic understanding of Virtual Machines on Azure and guide you about how to create and run a Virtual Machine on Azure.

Introduction

Setting up and managing servers and infrastructure needed to power our development takes a lot of time. These obstacles could be removed if we developers could provision our own servers. It is also easier for enterprises of all sizes to benefit from the high performance and availability of the network without the cost of running your own hardware. Azure virtual Machine is an ideal solution in many ways. An Azure virtual machine gives you the flexibility of virtualization without spending the time and money to buy and maintain the hardware that hosts the virtual machine.

Azure Virtual Machines

Azure Virtual Machines are one of the central features of Azure's IaaS capabilities. It supports the deployment of Windows Server or Linux Virtual Machines (VMs) in a Microsoft Azure datacenter.

There are two tiers for Azure Virtual Machines, Basic and Standard. The differences are Standard tier is well suited for more consistent performance on the CPU and network, while it also offers load-balancing and auto-scaling whereas Basic does not offer these features. You can use both Basic and Standard tiers for production workloads, depending upon your needs. Azure offers many images, you can also use your own images.

You can create a VM in Azure by:

  • The Azure Portal or Azure Preview Portal- GUI based
  • Azure CLI or Azure PowerShell- Command Shell

Virtual Machine Status

Azure VMs have the following three possible states:

  • Running: The VM is on and running normally.
  • Stopped: The VM is stopped, but it is still consuming compute resources within Azure.
  • Stopped (Deallocated): The VM is stopped and it is not consuming computer resources within Azure.

Billing

Azure Virtual machines are billed on per-minute basis.

There is a direct relationship between the VM's status and billing, if the VM is in Running or in Stopped state, it is billable. You have to completely place the VM in dealllocated state to stop the billing.

Creating Virtual Machines

One of the easiest ways to get started creating Azure VMs is to use the Azure Management Portal or the Azure Preview Portal. This tip will guide you step by step to create a Virtual Machine on Azure. Windows Azure offers many images, we will be creating Windows Server 2012 R2 Datacenter image for the sake of this tutorial.

Image 1

  • Log into the Azure Preview Portal at http://portal.azure.com. At this point, you will need an Azure subscription. If you don’t have one, you can sign up for a free trial at http://azure.microsoft.com.
  • To get started, click +NEW in the upper-left corner of the screen.
  • In the New blade, click Compute, and then click Windows Server 2012 R2 Datacenter for the purposes of this example.

Image 2

  • On the Create VM blade, fill in the Host Name you want for the VM, the administrative User Name, and a strong password.
    • Host Name - The name of the VM
    • User Name - The administrative user name
    • Password - The password for the administrative user
    • Pricing Tier - Expand this lens to view all the different pricing

Image 3

Optional Configuration - Expand this lens to control several important settings, such as:

  • The cloud service name (the DNS name; for example, contoso.cloudapp.net). Whether operating system automatic updates (that is, Windows Update) is enabled (default is ON).
  • The storage account to store the operating system disk’s virtual hard drive (VHD).
  • Any Virtual Network options (the VM will be placed in its own Virtual Network unless otherwise specified).
  • Whether diagnostics should be enabled.
  • Resource Group-Provides a logical container for Azure resources (to help manage resources that are often used together).
  • Location - The Azure region where the VM should be placed.

Image 4

  • When finished, click the blue Create button to instruct Azure to start creating your VM. This process could take several minutes.
  • After Azure creates the VM, you'll see it on your Startboard.

Image 5

 

Connect to a Virtual Machine

When creating a VM using the Azure Preview Portal, Remote Desktop is enabled by default. To connect to the VM, select the Connect button from the top of the desired VM blade.

Image 6

Open the RDP file and connect to the VM.

You will need to provide the administrative user name and password set when initially provisioning the VM.

Image 7

You can now work with the virtual machine.

Image 8

Stopping VM

By default, stopping a VM in the Azure Management Portal puts the VM into the Stopped (Deallocated) state. If you want to stop the VM but keep it allocated, you will need to use the PowerShell.

cmdlet: Stop-AzureVM -Name "az-essential" -ServiceName "az-essential" -StayProvisioned.

Shutting down the VM from the operating system of the VM will also stop the VM but will not deallocate the VM.

If you are creating your Aure Virtual Machine for testing purposes, please make sure to place it in Stopped(Deallocated) state.

Points of Interest

Microsoft Azure provides massive amounts of infrastructure you can utilize to run your applications and systems. And, you always can scale up or out whenever you like. We can now set up an environment that closely resembles our production environment, and it won't cost much as Azure bills us by hour. By distributing load across virtualized machines, Azure VM are able to ensure high availability of applications and data. Even if one server fails, another virtual machine can be spun up with minimal downtime or data loss.

History

  • V1 of tip

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
Pooja Baraskar is an accomplished software engineer, inventor, and technical author with over a decade of experience in the tech industry. With a passion for innovation and a commitment to excellence, Pooja has established herself as a thought leader and an agent of change in the industry. Currently, Pooja is leading various developer programs globally at Intel, leveraging her expertise and vision to drive impactful initiatives that shape the industry and empower tech professionals around the world.
As a tech trailblazer, Pooja is passionate about challenging the status quo and driving innovation. She is a pioneer in areas such as artificial intelligence and the Internet of Things and has a proven ability to translate complex technical concepts into accessible and actionable ideas. She has an impressive track record of delivering results in complex, high-stakes projects and is continually seeking new ways to drive value and make a difference.
Pooja is also an accomplished technical author. Her writing is known for its clarity, accessibility, and technical accuracy, making her a trusted source of information for developers and tech enthusiasts around the world. Digital courseware For Educators for OpenVINO developer by her has been used to teach AI in several universities across the globe, helping to equip the next generation of tech professionals with innovative skills. Pooja is an active member of the tech community, sharing her expertise through speaking engagements, workshops, and mentorship. Her contributions to the field have been widely recognized, including being named a Top Software Innovator by Intel and a Most Valuable Professional by Microsoft.
In addition to her work in the tech industry, Pooja is an avid traveler, passionate cook, and skilled martial artist. Her diverse interests and experiences have given her a well-rounded perspective on life and work, allowing her to approach challenges with creativity, energy, and enthusiasm.

Comments and Discussions

 
QuestionVM create on load? Pin
User 418025415-Oct-18 3:02
User 418025415-Oct-18 3:02 
GeneralMy vote of 5 Pin
Vaso Elias8-Jun-15 2:11
Vaso Elias8-Jun-15 2:11 
QuestionNicely Pin
Michael Breeden2-Jun-15 10:03
Michael Breeden2-Jun-15 10:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.