Creating Azure Virtual Machines

DZone 's Guide to

Creating Azure Virtual Machines

· Cloud Zone ·
Free Resource

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 size 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 is one of the central features of Azure’s IaaS capabilities, together with Virtual Networks. Azure Virtual Machines supports the deployment of Windows Server or Linux virtual machines (VMs) in a Microsoft Azure datacenter. You have total control over the configuration of the VM. You are responsible for all server software installation, configuration, and maintenance, as well as operating system patches.

Virtual Machine Status:

Azure VMs have 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 compute resources within Azure.

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 a 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.


Azure Virtual Machines is priced on a per-hour basis, but is billed on a per-minute basis.The cost for a VM includes the charge for the Windows Server operating system.The cost, and the appropriate licensing, for any additional software you want to install is your responsibility.

There is a direct relationship between the VM’s status and billing:

Running -Billable
Stopped -Billable
Stopped (Deallocated) -Not billable

Creating Virtual Machines

There are two tiers for Azure Virtual Machines, Basic and Standard. VMs in the Basic tier are well suited for workloads that do not require load balancing or the ability to autoscale. VMs in the Standard tier support all Azure Virtual Machines configurations and features.

Within the Basic and Standard tiers, there are various VM sizes available. The A-series VMs are the ―traditional sizes that have been around since Azure Virtual Machines was first introduced. The D-series VMs were introduced in September 2014, and they feature faster processors, a higher memory-to-core ratio, and a solid-state drive (SSD) for the temporary physical disk.

When you create a VM, you get two disks: an OS disk that is persisted in Azure blob storage and a temporary disk. The temporary disk is a physical disk located within the chassis of the server. The temporary disk (which is referred to as the D drive for Windows VMs uses a traditional HDD platter for the A-series and SSD for the D-series VMs.

One of the easiest ways to get started creating Azure VMs is to use the Azure Management Portal or the Azure Preview Portal.

Azure preview portal

• 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.


• 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 .


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).
  • Subscription- The Azure subscription to use if you have more than one.
  • Location – The Azure region where the VM should be placed.


• 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.


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.


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.


You can now work with the virtual machine.



As with most Azure services, Azure Virtual Machines follow a scale out, not scale up, model. This means it is preferable to deploy more instances of the same configuration rather than adding larger, more powerful machines.

Before VMs can be scaled ,the instances must be placed within an availability set. When determining the scale out approach for VMs, it is important to determine the maximum number of VMs, because that maximum number of VMs must be created, configured, and placed into an availability set. When it comes time to scale out, the VMs within the availability set are used to fulfill the scale-out needs. VMs within an availability set should all be the same size to take advantage of Azure’s autoscale feature.

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 now can 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.

azure, azure blob storage, azure virtual machines, cloud, iaas, microsoft azure, tutorial, virtual machines, vms

Published at DZone with permission of Pooja Baraskar , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}