Deploying Virtual Machines in Microsoft Azure

Deploying Virtual Machines in Microsoft Azure

August 23, 2016 1 By Eric Shanks

Congratulations! If you’ve made it this far in the Microsoft Azure Series, you’re finally ready to start deploying virtual machines in Microsoft Azure. Let’s face it, the whole series has led up to this post because most of you are probably looking at getting started in Azure with the virtual machine. It’s familiar and can house applications, databases, data or whatever you’ve been housing in in your on premises data center. If you’re trying to benchmark Azure with you’re own data center apps, virtual machines are probably where you’ll spend your time. As you learn more about the the platform, Azure’s PaaS offerings might be more heavily used to prevent you from having to manage those pesky operating systems but for now we’re focusing on the VM.


In the new portal (formerly called the ARM portal) click the “New” button. Select Virtual Machines and then select your Featured App. The feature app an contain bare operating systems in a variety of versions and flavors.


Once you’ve selected an app, review the terms and select a deployment model. We’re focusing on the new portal for this series primarily, so choose resource manager.


Now a new set of “blades” opens and we’ll need to enter some information.

NOTE: These options might vary a bit depending on the location and the operating system.

Enter a server name, and a disk type of either SSD or HDD. Then enter a username for the person who will have administrator access on the box. If you choose a linux distribution you may need to select an authentication type so that you can use an SSH key instead of a password. As with all Azure resources, choose a resource group, and then finally select a location.


The next screen will show you some recommended “t-shirt” sizes for the virtual machine. Select the size that is appropriate for your workload.AzureVM_4

On the next blade we need to select some placement information. Select the disk type, storage account, VNet and subnet, public IP address if needed and a security group. You can also enable monitoring for this machine. Monitoring will allow you to track information about the performance of the virtual machine and possibly alert based on those metrics. Another cool thing we can do on this blade is add a virtual machine extension. Extensions allow you to have some automated tasks performed on your virtual machine like install the Chef Client. To learn more about extensions check out You can finally select the availability group that the machine should belong with so that your app can withstand an outage of a singe Azure zone.


Review the settings and click create.



In a few moments your machine will be built and you’ll be able to RDP or SSH into it with the credentials provided in the setup screens. If you are unable to login, check to make sure your subnet is reachable and that no network security groups are blocking the RDP or SSH traffic to the new machine. Install your apps and have fun with your new virtual machine.

Deploy from PowerShell

If you’re one of those people who love to do their work from the command line, or you want to programmatically deploy your servers for an application pipeline or something, you can also deploy your virtual machines through PowerShell. Here is some sample code to get you started.

The code below requires you to enter in a few variables and will deploy a virtual machine in the Azure Resource Manager (new) Portal. It requires you to login and enter local administrator credentials for the machine. You will be prompted to enter these two sets of credentials unless you modify the below code. You may also download this code from my git repo: