With the new Azure Virtual Machines it is now possible to run SharePoint 2010 and 2013 workloads. In my TechEd talks you can learn about the various options to run SharePoint on Azure.
I won’t rehash those talks again here. What I do want to share is some of the PowerShell code I used to build the farms. First a caveat that these are just rough scripts that I used to build the demo and have lots of opportunities for improvements. The script are good at demonstrating the various steps that are involved with building the Farm. Here is a diagram of the farm that we will build.
To get started read Automating Windows Azure Virtual Machines with PowerShell. Also if you are new to Azure Virtual Machines here is a crash course on the features that we will cover in the PowerShell scripts: Learn about Windows Azure Virtual Machines. With that out of the way let’s get started.
The first step is to create the virtual network. In the past the Cloud Service (previously called hosted services) was the container for multiple VMs to talk to each other. Now the Virtual Network (VNet) allows multiple Cloud Services to talk to each other. So in the case of our Farm we want the Active Directory/Domain Controller (AD/DC) to be in one Cloud Service and talk to the rest of our farm in another Cloud Service. By using 2 Cloud Services, you can start the AD/DC first and have the other Cloud Services join the domain, since we do not have static IPs. Here is the script to create the VNet.
Once the VNet is in place you can create the Active Directory/Domain Controller. All this script does is create a VM in a Cloud Service. Once the VM is started you will need to manually RDP connect to the machine and run DCPROMO. Once DCPROMO is finished run ipconfig to determine the IP of the machine, which will be used in the Farm setup script.
The last step is to create the SharePoint Farm.