Defining virtual machine state in Azure

In this post, we’ll explore how we can leverage desired state configuration feature of PowerShell to define the desired configuration of Azure virtual machine. Up to this point, we’d explored how to define the OS/Size/Storage/Network and other related configuration using Get-AzureVM and associated cmdlets. What if one can go a bit further, and also define server configuration at the same time.

Do note that we’ll need to have PowerShell version 4.0 or greater on the client machine to use related commands …Continue Reading

Get Azure virtual machine location

The virtual machine location is the Azure region the virtual machine will be created in. The location of the virtual machine also determines the location requirement of the underlying storage, and if specified the virtual network. The virtual network and storage account must reside in the same location as the virtual machine.

The service management API enforces this requirement as well. Attempting to create a virtual machine with the storage account or the virtual network in a remote region will result in an error. …Continue Reading

Configuration options available in New-AzureQuickVM vs New-AzureVM

Here’s quick summary of configuration options available in New-AzureQuickVM vs New-AzureVM:

New-AzureQuickVM New-AzureVMConfig and New-AzureVM
Windows and Linux supported Windows and Linux supported
Create only from image Create from image or operating system disk
Specify availability set name Specify availability set name
Specify subnet and virtual network Specify subnet and virtual network
Deploy to location or affinity group Deploy to location or affinity group
Deploy X509 certificates Deploy X509 certificates
Deploy SSH certificates on Linux virtual machines Deploy SSH certificates on Linux virtual machines
Specify DNS settings Specify DNS settings
Wait for boot switch Wait for boot switch
Disable WinRMHttps Disable WinRMHttps
Enable/Disable Windows Remote management endpoint Enable/Disable Windows Remote management endpoint
Specify Active Directory domain join information
Require admin password reset on first login
Create new or attach existing data disks
Configure endpoints (including internal and external load balancing)
Disable Windows Updates
Specify the time zone
Specify static IP addresses
Specify reserved IP address of the  cloud service/domain name

Create Azure virtual machine using PowerShell

If you are looking to create Azure virtual machine using PowerShell, you have same two options as in classic Azure management portal. To start with, you need to first authenticate to Azure using PowerShell:

In the output, you can see current storage account associated with your subscription. If the CurrentStorageAccountName is empty, you’ll need to associate an storage account with your subscription. To do this, use Set-AzureSubscription cmdlet …Continue Reading

Create Azure Virtual Machines using Azure Management Portal

This post will discuss how to create an Azure virtual machine using azure management portal, https://manage.windowsazure.com.

When you are going to create an Azure VM, you have two options:

  1. Create Quick VM. This allows you to create VMs very quickly with only basic details such as DNS name, administrator account username and password, vm location, etc. However you cannot create VM based on image and specify other details etc.
  2. Create VM from gallery. You can use this to specify VM configuration in detail, including storage account, service names, etc.

…Continue Reading