Rolling out Images for SharePoint farm in Windows Azure

In this fifth post in the series on creating a SharePoint farm in Windows Azure we will look at the main script used to create the VMs.

For those who might have missed the previous posts they are:

The script will automatically create and domain join the remaining 7 virtual machines required by our design: 2 web front-end servers, 2 application servers and 3 SQL Servers (one principal, one mirror and one witness).

An upcoming post will talk about the SQL Server installation, but just a few comments at this point. As described in the initial post, the SQL Servers are installed in a high-safety mode, that is the database mirroring session operates synchronously and uses a witness as well as the principal server and mirror server. For better performance mirroring can be enabled in high-performance mode where the database mirroring session operates asynchronously and uses only the principal server and mirror server. Note however, that the only form of role switching is forces service (with possible data loss).

To ensure we target the correct account we first set the active subscription:

# your imported subscription name
$subscriptionName = “MySubscription”
$storageAccount = “mystorageaccount”
Select-AzureSubscription $subscriptionName
Set-AzureSubscription $subscriptionName -CurrentStorageAccount $storageAccount

Next we set the Cloud Service Parameters. This is the “public” container holding all the VMs. It is also what allows up to load balance the two front-end servers as they will share the same VIP. Remember, that the service name must be unique, so SP-Service is most likely already taken.

# Cloud Service Parameters
$serviceName = “SP-Service”
$serviceLabel = “SP-Service”
$serviceDesc = “Cloud Service for SharePoint Farm”

Some more configuration options about base images and the virtual network.

# Image create in post: Creating a Base Image for use in Windows Azure
$spimage = ‘spbase100gbws2008r2’
$sqlimage = ‘base100gbsysprep’
$vnetname = ‘SP-VNET’
$subnetNameWFE = ‘SP-WFESubnet’
$subnetNameApp = ‘SP-AppSubnet’
$subnetNameSql = ‘SP-SqlSubnet’
$ag = ‘SP-AG’
$primaryDNS = ‘’

As shown in the first post we will place the three layers (front-end, application and database) in three different availability sets.

# Availability Sets
$avset1 = ‘avset1’
$avset2 = ‘avset2’
$avset2 = ‘avset3’

The domain settings from when we configured the domain

# Domain Settings
$domain = ‘lab’
$joindom = ‘’
$domuser = ‘administrator’
$dompwd = ‘P@ssw0rd’
$advmou = ‘OU=AzureVMs,DC=lab,DC=azure’

The location of the VHD-files

# MediaLocation
$mediaLocation =


Next we set the configuration for the different VMs. Please note, that I have just set the size to Small and Medium.

Also note, that I have defined a prope port and path for the two front-end servers. This is what the Load Balancer (LB) uses to check if traffic should be forwarded to the servers.

It will also be obvious, that I have only create/attached one extra disk to the SQL Servers. In a production setup you should not place data, log and temporary files on the same disk.

# Create SP WFE1
$size = “Small”
$vmStorageLocation = $mediaLocation + “sp-wfe1.vhd”
$spwfe1 = New-AzureVMConfig -Name ‘sp-wfe1’ -AvailabilitySetName $avset1 -ImageName $spimage -InstanceSize $size -MediaLocation $vmStorageLocation |
Add-AzureProvisioningConfig -WindowsDomain -Password $dompwd -Domain $domain -DomainUserName $domuser -DomainPassword $dompwd -MachineObjectOU $advmou -JoinDomain $joindom |
Add-AzureEndpoint -Name ‘http’ -LBSetName ‘lbhttp’ -LocalPort 80 -PublicPort 80 -Protocol tcp -ProbeProtocol http -ProbePort 80 -ProbePath ‘/healthcheck/iisstart.htm’ |
Set-AzureSubnet $subnetNameWFE

# Create SP WFE2
$size = “Small”
$vmStorageLocation = $mediaLocation + “sp-wfe2.vhd”
$spwfe2 = New-AzureVMConfig -Name ‘sp-wfe2’ -AvailabilitySetName $avset1 -ImageName $spimage -InstanceSize $size -MediaLocation $vmStorageLocation |
Add-AzureProvisioningConfig -WindowsDomain -Password $dompwd -Domain $domain -DomainUserName $domuser -DomainPassword $dompwd -MachineObjectOU $advmou -JoinDomain $joindom |
Add-AzureEndpoint -Name ‘http’ -LBSetName ‘lbhttp’ -LocalPort 80 -PublicPort 80 -Protocol tcp -ProbeProtocol http -ProbePort 80 -ProbePath ‘/healthcheck/iisstart.htm’ |
Set-AzureSubnet $subnetNameWFE

# Create SP App1
$size = “Small”
$vmStorageLocation = $mediaLocation + “sp-app1.vhd”
$spapp1 = New-AzureVMConfig -Name ‘sp-app1’ -AvailabilitySetName $avset2 -ImageName $spimage -InstanceSize $size -MediaLocation $vmStorageLocation |
Add-AzureProvisioningConfig -WindowsDomain -Password $dompwd -Domain $domain -DomainUserName $domuser -DomainPassword $dompwd -MachineObjectOU $advmou -JoinDomain $joindom |
Set-AzureSubnet $subnetNameApp

# Create SP App2
$size = “Small”
$vmStorageLocation = $mediaLocation + “sp-app2.vhd”
$spapp2 = New-AzureVMConfig -Name ‘sp-app2’ -AvailabilitySetName $avset2 -ImageName $spimage -InstanceSize $size -MediaLocation $vmStorageLocation |
Add-AzureProvisioningConfig -WindowsDomain -Password $dompwd -Domain $domain -DomainUserName $domuser -DomainPassword $dompwd -MachineObjectOU $advmou -JoinDomain $joindom |
Set-AzureSubnet $subnetNameApp

# Create SQL Server1
$size = “Medium”
$vmStorageLocation = $mediaLocation + “sp-sql1.vhd”
$spsql1 = New-AzureVMConfig -Name ‘sp-sql1’ -AvailabilitySetName $avset3 -ImageName $sqlimage -InstanceSize $size -MediaLocation $vmStorageLocation |
Add-AzureProvisioningConfig -WindowsDomain -Password $dompwd -Domain $domain -DomainUserName $domuser -DomainPassword $dompwd -MachineObjectOU $advmou -JoinDomain $joindom |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 100 -DiskLabel ‘datalog’ -LUN 0 |
Set-AzureSubnet $subnetNameSql

# Create SQL Server 2
$size = “Medium”
$vmStorageLocation = $mediaLocation + “sp-sql2.vhd”
$spsql2 = New-AzureVMConfig -Name ‘sp-sql2’ -AvailabilitySetName $avset3 -ImageName $sqlimage -InstanceSize $size -MediaLocation $vmStorageLocation |
Add-AzureProvisioningConfig -WindowsDomain -Password $dompwd -Domain $domain -DomainUserName $domuser -DomainPassword $dompwd -MachineObjectOU $advmou -JoinDomain $joindom |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 100 -DiskLabel ‘datalog’ -LUN 0 |
Set-AzureSubnet $subnetNameSql

# Create SQL Server 3 (Witness)
$size = “Medium”
$vmStorageLocation = $mediaLocation + “sp-sql3.vhd”
$spsql3 = New-AzureVMConfig -Name ‘sp-sql3’ -ImageName $sqlimage -InstanceSize $size -MediaLocation $vmStorageLocation |
Add-AzureProvisioningConfig -WindowsDomain -Password $dompwd -Domain $domain -DomainUserName $domuser -DomainPassword $dompwd -MachineObjectOU $advmou -JoinDomain $joindom |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 100 -DiskLabel ‘datalog’ -LUN 0 |
Set-AzureSubnet $subnetNameSql

$dns1 = New-AzureDns -Name ‘dns1’ -IPAddress $primaryDNS

Last thing is to call New-AzureVM to actually create the VMs.

New-AzureVM -ServiceName $serviceName -ServiceLabel $serviceLabel `
-ServiceDescription $serviceDesc `
-AffinityGroup $ag -VNetName $vnetname -DnsSettings $dns1 `
-VMs $spwfe1,$spwfe2,$spapp1,$spapp2,$spsql1,$spsql2,$spsql3


Now go grab a cup of coffee and wait for your VMs to be provisioned, domain joined and started.

When done you should see something like the following in the PowerShell windows:


Looking in the portal:


In the next post we will look at how to set up the SQL servers in a mirror. Not really an Azure subject, but still something you what to do to ensure redundancy.

Posted in Azure | Leave a comment

Creating a DC/AD for use in Windows Azure

In the fourth post on the experiences gained during the creation of a SharePoint farm in Windows Azure will look at establishing the domain controllers and active directory.

The previous three were:

Most of the details in this post is really not Azure-specific. We are going to deploy a couple of VMs, but we have already seen how to do that in the last blog post. We are then going to promote these VMs to domain controllers and configure a new forest. If you know anything about infrastructure, you properly know more about this than I do. If not read on.

Open a Windows Azure PowerShell prompt. We first set the subscription name and storage account.

# your imported subscription name
$subscriptionName = “MySubscription”
$storageAccount = “mystorageaccount”

Select-AzureSubscription $subscriptionName
Set-AzureSubscription $subscriptionName -CurrentStorageAccount $storageAccount

We then set the image name, size of VM, location to store the VDH-file, what subnet to deploy the VMs into and finally the (local) admin password.

# Domain Controller Paramaters
$imageName = ‘’
$size = “Small”
$mediaLocation = “”
$subnet = ‘SP-ADSubnet’
$password = ‘P@ssw0rd’

The command to get a list of available images from the gallery is:

Get-AzureVMImage | Select ImageName

We are going to install the domain controllers into their own could service. It could just as well be the one containing the rest of the servers for the SharePoint farm, but I personally prefer to have them separately. Remember that the service name must be unique.

# Cloud Service Paramaters
$serviceName = “DC-Service”
$serviceLabel = “DC-Service”
$serviceDesc = “Cloud Service for DC for SharePoint Farm”
$vnetname = ‘SP-VNET’
$ag = ‘SP-AG’

The VNET and affinity group are the ones created during the creation of the VNET.

The configuration for the first domain controller. Notice that we add an extra disk to both VM. This if for the (AD) global catalog.

# Create VM Configuration (DC1)
$vmName = ‘sp-dc1’
$vmStorageLocation = $mediaLocation + “sp-dc1.vhd”
$dc1 = New-AzureVMConfig -Name $vmName ‘
-InstanceSize $size ‘
-ImageName $imageName ‘
-MediaLocation $vmStorageLocation |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 20 -DiskLabel ‘data’ -LUN 0

Add-AzureProvisioningConfig -Windows -Password $password -VM $dc1
Set-AzureSubnet -SubnetNames $subnet -VM $dc1

Configuration for the second domain controller:

# Create VM Configuration (DC2)
$vmName = ‘sp-dc2’
$vmStorageLocation = $mediaLocation + “sp-dc2.vhd”
$dc2 = New-AzureVMConfig -Name $vmName ‘
-InstanceSize $size ‘
-ImageName $imageName ‘
-MediaLocation $vmStorageLocation |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 20 -DiskLabel ‘data’ -LUN 0

Add-AzureProvisioningConfig -Windows -Password $password -VM $dc2
Set-AzureSubnet -SubnetNames $subnet -VM $dc2

And finally we execute the New-AzureVM command.

# Create the DCs
New-AzureVM -ServiceName $serviceName -ServiceLabel $serviceLabel ‘
-ServiceDescription $serviceDesc -AffinityGroup $ag -VNetName $vnetname -VMs $dc1, $dc2

If all goes as expected we will have two new VMs. Looking under virtual machines in the Management Portal should give us something like the following:




Under Disks you can see that the extra data disk has been deployed as well as the OS disk.




And if you look under Cloud Services




The next step is to attach and format the data disk.

Open a remote desktop connection in to SP-DC1.

Go to Disk Management


The Initialize Disk dialog will pop up

Ensure the Disk is selected and press OK.


Right click on the unallocated disk (most likely Disk 2) and select New Simple Volume


Click Next on the welcome screen


Accept the default values and press Next.


Assign a drive letter and click Next.


Format the partition and click Next.


On the final screen review the settings and click Finish.


Once done you will have a nicely formatted disk ready to be put to use.

Viewed from the Disk Manager


And the file explorer


You need to preform the same steps for the second domain controller, so open a remote desktop connection into SP-DC2 and repeat the above steps.

The next thing to do is promote the server to a domain controller. The procedure for doing this has changed slightly going from Windows Server 2008 to Windows Server 2012.

A good guild with additional references can be found here.

The first thing to do is install the Role Active Directory Domain Services.

Open the Server Manager and select Add roles and features.


Click Next in the “Before you begin” dialog. You may want to check the “Skip this page” checkbox.


On the Select installation type ensure the first option is selected.


Select the local server as the destination server


In the dialog for selecting roles, select the Active Directory Domain Services


As soon as you make the selection the following dialog will pop up asking you add the required roles and features.

Click Add Features to accept.


Ensure the Active Directory Domain Services is selected and click Next.


In the select features dialog just click Next.


Click Next in the Active Directory Domain Services dialog.


Confirm the different selections and click Install.


The installation will now commence and you can follow the process.


As stated in the dialog you can close the wizard.

Once the installation process is complete you will be notified in the Server Manager.

Click the Promote this server link to promote the server to a domain controller.


This will start the AD DC Configuration Wizard.

Select Add a new forest and enter the Root domain name. Once the name is entered the Next button can be pressed.


Set the different Domain Controller Options and enter the DSRM password. Then click Next.


Click Next in the DNS Options dialog.


In the Additional Options dialog enter the NetBIOS domain name and click Next.


In the Paths dialog you have to select the location of the AD DS database, the log files and the SYSVOL. I have placed them on the extra disk we instantiated above. Click Next afterwards.


You can review the options and selections you have made in the dialog before actually starting the process. When satisfied, click Next.


Before the system will promote the server to a domain controller it will perform a number of prerequisites checks. If all looks good, press Install.


The server will reboot once the installation process is finalized. When it is up again you can log in with your AD credentials.

How that you have a running domain controller you can add the second one to the forest to ensure redundancy.

The first initial steps are the same: attach and format disk and install the Role Active Directory Domain Services. Once this is done promote the server to DC.

When you get to the Deployment Configuration you should not add a new forest, but add a domain controller to an existing domain.

Enter the domain name you specified during the configuration of the primary domain controller and click Next.


Select options and enter credentials; then press Next.


Click Next in the DNS Options dialog.


In the Additional Options dialog, select to replicate from Any domain controller and click Next.


As was the case with the primary domain controller we place the database, the log files and the SYSVOL on the extra disk. Click Next after this has been set.


Review the configuration and click Next to perform the prerequisites check.


If all is green click Install to begin installation.


When done we now have two domain controllers and an active directory ready to be configured.


Again this turned out to quite a long post. As stated in the beginning most of the steps are really not Windows Azure specific.

This stresses a very important point, namely that running a virtual machine in Windows Azure is just as easy as running a virtual machine on-premises or at a remote branch office.

We have now in a number of posts worked our way toward the main script or workload: creating the remaining 7 virtual machines that together with our two domain controllers will make up our SharePoint farm/environment.

The next post will focus on the PowerShell script to do this. It will turn out to be very similar to the one used above.

Posted in Azure | Leave a comment

Creating a Base Image for use in Windows Azure

This is the third blog post on the subject of creating and deploying a SharePoint farm in Windows Azure. The previous two are:

    In this post we will create an image that can be used when creating virtual machines. The advantage of this is, that it gives you the ability to “pack” the image/disk, both with software (installed or just the binaries) and – in our case – with an extended OS-disk.
    I assume that you have followed the initial steps and created the VNET, the storage account and the affinity group.
    We will use one of the images supplied in the gallery. To get the available images, submit the following command from a Windows Azure PowerShell prompt:

Get-AzureVMImage | Select ImageName

This will give you something similar to:


The name of the VM, Cloud Service and VHD-disk in the script below is not important as we will delete them later.

# Your Storage account
$storageAccount = “mystorageaccount”

# Your subscription name
$subscriptionName = “MySubscription“

Select-AzureSubscription $subscriptionName
Set-AzureSubscription $subscriptionName -CurrentStorageAccount $storageAccount

# VM Paramaters
$imageName = “”
$size = “Small”
$mediaLocation = “
$subnet = “SP-AppSubnet”
$password =
“P@ssw0rd” # This will be the password for the VM

$vmName = “sp-base”
$vmStorageLocation = $mediaLocation + “sp-base.vhd”
$bi = New-AzureVMConfig -Name $vmName ‘
-InstanceSize $size -ImageName $imageName ‘
-MediaLocation $vmStorageLocation
Add-AzureProvisioningConfig -Windows -Password $password -VM $bi
Set-AzureSubnet -SubnetNames $subnet -VM $base

# Cloud Service Paramaters
$serviceName = “BaseServiceImage”
$serviceLabel = “BaseServiceImage”
$serviceDesc = “Base Image. Will be deleted”
$ag = “SP-AG”

# Create the Base VM
New-AzureVM -ServiceName $serviceName ‘
-ServiceLabel $serviceLabel  ‘
-ServiceDescription $serviceDesc `
-AffinityGroup $ag -VMs $bi

We now have a plain VM running Windows Server 2012.

The following will be displayed in the PowerShell windows


If you log on to the management portal you will see the new VM under virtual machines. I have removed the name of the subscription due to certain confidentiality considerations, hence the black bar.



Next step is to extend the disk.

First we need to delete the VM just created. Ensure it is selected and then click Delete from the bottom menu.


and confirm


The system will begin to remove the VM.


and after a short while


Next step is to delete the disk.

Select Disk from the top menu


If the delete process is not completed you will see that the VM is still having a lease on the disk


Wait until the lease has expired


Delete the disk, but retail the VDH-file. This is very important as this is the one we wish to extend.


If you look in your storage account under the container vhds you can see, that the VHD-file is still there


Maarten Balliauw has created a small utility that will change the header information on the VHD-file allowing us to extend it. The maximum size is 127 GB; we will make it 100 GB.

Download the WindowsAzureDiskResizer tool from GitHub.

The syntax is the following:


You can get the accountname and accountkey from the storage page in the management portal.

As stated previously I set the size to 100


Before the tool was executed the VHD-file looked like this. Notice the size.


After running the tool the picture is the following:


Next step is to create an image using the VDH-file.

Select Images from the top menu under Virtual Machines.


and then click Create in the bottom menu


Enter a name and browse to the sp-base.vhd file


You need to check the “I have run Sysprep” even though that is not the case.

When the process is complete you can see the new image is available


We now want to create a new VM based on this new image, extend the disk from the Disk Manager, copy any software onto the disk or install it and when capture that VM.

I will show how this is done using the management portal, but you could amend the script above and just set the image name to

$imageName = “spbaseimage”

Select Virtual Machine Instances from the top menu


and then New from the bottom one.


You want to create a new VM from the gallery


Using your new image (the other two images are some I have created previously)



Give the VM a name, password and select the size


Give the VM a public facing DNS name and place it in the VNET. As we are actually not going to use this VM for anything other than begin the “template” for further work, it is more to ensure it is placed in our storage account.



Click OK to kick off the creating process.

Once the VM has been provisioned you want to open a Remote Desktop session (RDP) and log into it.

Enter the Disk Management

You can see the “original” 30 GB and the new unallocated 70 GB


Right click on C and select Extend Volume.


This will open up the Extend Volume Wizard.


Click Next.

Select the disk and the maximum size


and click Next again.


Click Finish to complete the wizard.

You now have a single OS volume of 100 GB.


The final step is to run Sysprep.

This is usually found in C:\Windows\System32\sysprep

Remember to set the Shutdown Option to Shutdown.


Press OK.

You can now Capture the VM. Select it and click Capture from the bottom menu. The VM has to be stopped before you can select the menu item.


Give the image a name and select the Sysprep option.



This turned out to be quite a long post.

In the next one in the series we will create the virtual machines for the two domain controllers and look at how to promote them to DCs.

Posted in Azure | Leave a comment

Creating a Virtual Network in Windows Azure

As announced in my last post I will in a number of blog posts walk through the steps taken to create a SharePoint farm in Windows Azure.

This post will explain how to setup a Virtual Network (VNET) in Windows Azure. It can be done in a number of ways the two obvious ones being either through the portal or using PowerShell. I will concentrate on the later.

The following will assume you have a Windows Azure subscription. If not sign up for on.

It will also assume that you have downloaded and install the PowerShell cmdlets for Windows Azure. If not get them here.

You have to be very careful when creating or changing the VNET settings. There is currently no validation so if you mess up, you will potentially take the whole farm off line. I usually download the existing setting, make the required modifications and then apply the settings again.

In the script shown below, we will just apply the settings contained in an XML-file, so we assume the download-amend has taken place.

Let us first look at the VNET configuration. The table below shown the configuration as described in the introduction post.

VNET Configuration
xmlns:xsi=”” >
<!– List as many DNS servers as you need. –>
<DnsServer name=”SP-DNS” IPAddress=”″/>
<LocalNetworkSites />
<VirtualNetworkSite name=”SP-VNET” AffinityGroup=”SP-AG”>
<Subnet name=”SP-ADSubnet”>
<Subnet name=”SP-AppSubnet”>
<Subnet name=”SP-WFESubnet”>
<Subnet name=”SP-SqlSubnet”>
<!– This is needed to reference the DNS servers listed above –>
<DnsServerRef name=”SP-DNS” />

As you can see the address scope of the VNET is defined as well as the four subnets. We have also defined a DNS server. The reason we can do this and be sure of the IP-address even before we have deployed the actual DC-servers is due to the way Windows Azure allocate IP-addresses. Azure will reserve the first three in a subnet for internal use, so the first available one will always be .4. Because we have put the (two) domain controllers into their own subnet we know it will always have the IP-address

The first thing you want to do is download the publishing settings for your subscription. Open an Internet Explorer browser and go to

Open an elevated Windows Azure PowerShell prompt.

If you have not executed any PowerShell before you may have to set the execution policy to RemoteSigned. This is done with the following command:

Set-ExecutionPolicy RemoteSigned

You import the publishing settings using the command:

Import-AzurePublishSettingsFile ‘[YOUR-PUBLISH-SETTINGS-PATH]’

You need the name of your subscription and it can be obtained with the following command:

Get-AzureSubscription | select SubscriptionName

You also need to decide in what data center your solution should be hosted. A list of the available locations can be found executing the command:

Get-AzureLocation | select displayname

We are now ready to create the VNET.

A few things to note. We first create a so called affinity group. Affinity groups are a way to physically group Windows Azure services together at the same data center to increase performance.

The name of the variable AGName must corresponded with the the attribute AffinityGroup in the XLM-file containing the VNET configuration.

The name of the storage account must be globally unique. You will get an error if you try to select one that is not available.

Now execute the following:

# Affinity Group parameters
$AGLocation = “West Europe”
$AGDesc = “Azure Affinity Group”
$AGName = “SP-AG”
$AGLabel = “SP-AG”

# Create a new affinity Group
New-AzureAffinityGroup -Location $AGLocation -Description $AGDesc `
-Name $AGName -Label $AGLabel

$storageAccount = “[Storage Account Name]”
$label = “SharePoint Storage Account”

# Create storage account
New-AzureStorageAccount -StorageAccountName $storageAccount `
-Label $label -AffinityGroup $AGName

# Your subscription name
$subscriptionName = “[Name of your subscription]”

Select-AzureSubscription $subscriptionName
Set-AzureSubscription $subscriptionName -CurrentStorageAccount $storageAccount

# Clear current settings
Remove-AzureVNetConfig -ErrorAction SilentlyContinue

# Apply new network
$configPath = (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) `
+ “\SharePointFarmVNET.xml”

Set-AzureVNetConfig -ConfigurationPath $configPath

You can check the result by the following command:

# Get-AzureVNetConfig | Select -ExpandProperty XMLConfiguration

Or you can log into the management portal. If all went well you should see something along the lines of:





In the next post we will create the base image(s) and extend the OS-drive from the default 30 GB to 100 GB.

Posted in Azure | Leave a comment

Creating a SharePoint Farm in Windows Azure

I have recently been involved in a (pilot) project moving a public facing SharePoint farm to Windows Azure. This will be the first of a series of blog posts “from the trenches” about the different steps taken to achieve this goal.

First a few words on the architecture. For the pilot it was decided that a separate Active Directory forest would be created in Azure and as no other on-premise resources was required we avoided the task of setting up a VPN. Time permitting I may describe these tasks in a future blog post.

A few words on availability sets and Windows Azure. To ensure the availability of the application you would use multiple Virtual Machines (VMs). By using multiple VMs, you can make sure that your application is available during local network failures, local disk hardware failures, and any planned downtime that the platform may required.

You manage the availability of your application that uses multiple VMs by adding the machines to an availability set. Availability sets are directly related to fault domains and update domains. A fault domain in Windows Azure is defined by avoiding single points of failure, like the network switch or power unit of a rack of servers. In fact, a fault domain is closely equivalent to a rack of physical servers. When multiple virtual machines are connected together in a cloud service, an availability set can be used to ensure that the machines are located in different fault domains. Also, by placing the VMs into the same availability set, you ensure that the fabric controller will never shut all of them down at the same time, e.g. for maintenance of the OS.

In all we defined four availability sets, one for the domain controllers and one for each of the tiers in the applications: The frontend servers, the application servers and the database servers.

To ensure redundancy and automatic failover the SQL Servers are established in a mirror setup with a witness server.

All VMs are placed in a Virtual Network (VNET), with each tier in its own subnet; the domain controllers also got their own. In the current release of Windows Azure all VM can by default see each other and it is not easily done to change this, but this is being worked on for future releases, hence the sub-netting.

The address scope for the VNET is

The table below gives the VNET configuration:

Name Description Address Scope
ADSubnet AD/DNS subnet
AppSubnet Application server subnet
WFESubnet Frontend server subnet
SQLSubnet SQL Server subnet

The figure below shows the topology of the VMs in Windows Azure.

The internal load balancer in Windows Azure will distribute load between the front-end servers.



The following table shows the configuration of the VMs.

Name Description OS Disks
DC1 Domain Controller Windows Server 2012 1 x 30 GB (OS)
1 x 20 GB
DC2 Domain Controller Windows Server 2012 1 x 30 GB (OS)
1 x 20 GB
WFE1 Frontend Server Windows Server 2008 R2 1 x 100 GB
WFE2 Frontend Server Windows Server 2008 R2 1 x 100 GB
App1 Application Server Windows Server 2008 R2 1 x 100 GB
App2 Application Server Windows Server 2008 R2 1 x 100 GB
SQL1 Primary Database Server Windows Server 2012 2 x 100 GB
SQL2 Secondary Database Server Windows Server 2012 2 x 100 GB
SQL3 Witness Database Server Windows Server 2012 2 x 100 GB

Due to business requirements SharePoint 2010 is used. The SQL Server is 2012 Enterprise Edition.

The size of the OS drive on the images supplied by the gallery in Windows Azure is only 30 GB. To ensure we had enough space “to play around” I created two base images (one for Window Server 2008 R2 and one for Windows Server 2012) each having 100 GB on the OS-drive. As I did not want to upload 100 GB I used a small trick and utility to change the header information of the VHD-file, hence expanding the drive from the original 30 GB to 100 GB. More about this in one of the future posts. All the required bits were placed on the base images. This way we only had to download and distribute them once.

The two domain controllers were created from the images supplied by the gallery.

In the next post I will look at creating the VNET.

Posted in Azure | Leave a comment

Windows Phone App: Susaalandets Skole

I recently had my third app for the Windows Phone certified and made available for download (currently only in the US and Danish stores).

The app, named Susaalandets Skole, is a small app displaying information about the schedule for a given class, the canteen menu, contact information, local weather and so forth for our local (public) school. A few screen shots can be found at the “marketing site” for the app.




All information is read from a Windows Azure Database using a web service as data access layer, so nothing is hardcoded (except for the address of the web service).

I have localized the service for Danish and English. I could not get it certified, when I had the Danish texts hardcoded.

The weather information is streamed from the Norwegian weather service YR.NO.

The menu from the canteen is shown for the current month. I have an agent that automatically downloads the new menu and updates the database from the PDF-file. That is, I download the menu and perform the update. We may be living in 2012, but the school is using the notorious SkoleIntra and it does not support any way to interface with an electronic menu.

I currently only know of one student on the school owning a Windows Phone, namely my oldest son. We have worked together on the design and content, and it has been great fun, so it does not really matter if I don’t get hundreds of downloads. We have already come up with a couple of new features, like notifications T minutes before a lesson is about to start, ability to send “I will be late” SMS to the teacher and a couple of others.

I initially wanted to put a map of the school in the app using Bing maps, which would allow you to zoom, tag the different building and so on. Unfortunately the resolution on Bing where I live is to low for this to work.

Should anyone be interested in the code, let me know and I’ll put it on github or similar.

Posted in Windows Phone 7 | Tagged | Leave a comment

MetroReads: Goodreads for the Windows Phone

My second app for the Windows Phone platform got certified today!

It is an app to use with From their site:

“Goodreads is the largest site for readers and book recommendations in the world. We have more than 8,600,000 members who have added more than 300,000,000 books to their shelves. A home for casual readers and bona-fide bookworms alike, Goodreads users recommend books, compare what they are reading, keep track of what they’ve read and would like to read, find their next favorite book, form book clubs and much more. Goodreads was launched in January 2007. ”

Check out the “marketing site” for screen shots and link to Marketplace.


Posted in Windows Phone 7 | Tagged | Leave a comment

Start Windows8 in Desktop

Tired of Windows 8 starting up in Metro? Is your first action to switch to Desktop after starting up? Worry no more! If you set a registry key, you can control if Windows 8 should boot in Desktop rather than Metro.

— snip  —

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

“Shell”=”explorer.exe /select,explorer.exe”

— snip  —

Posted in Tips | Tagged | Leave a comment

Pull the Rabbit out of the Machine

Today I got RabbitMQ In Action from Manning in the mail. As I have prevous written about, I did a 2nd review on the book. I am, however, looking forward to reading the complete book and play around with the Rabbit.

Last year, I also reviwed Machine Learning In Action also by Manning. Manning was also kind enough to mail me a copy of this book. Since my master thesis I have only worked briefly with artificial neural networks, so it was fun to play around with these kinds of models again. I also enjoyed the examples in Python, an area I have not had the pleasure of doing much work with.

I wrote in my last post about SOA Patterns. This book is about to go into print and when it does I’ll post a picture of the front. Now I can only find one with the MEAP-sign plastered over it.

Posted in Miscellaneous | Tagged | Leave a comment

Review of books: SOA Patterns by Arnon Rotem-Gal-Oz

I have previously written a small blog post about reading SOA Patterns by Arnon Rotem-Gal-Oz by Manning. That time is was what was called a 2/3 review, hence a peer review of the material currently present.

A couple of weeks ago I was approached by Manning and asked if I wanted to do the technical proof reading of the book. I thought about it for a day and two and then accepted the offer.

The book is made up of 10 chapters. Part I (chapters 1 through 7) is titled SOA Patterns and gives, both an overview of SOA and a deep dive into the various patterns and their usage. Part II is called Applying SOA Patterns and is made up of the remaining three chapters. Chapter 8 is about anti-patterns, chapter 9 a case study and chapter 10 a comparison of SOA with other architectural styles.

The full Table of Contents is:

Part I – SOA Patterns

  • Solving SOA Pains with Patterns
  • Basic Structural Patterns
  • Pattens for Performance, Scalability and Availability
  • Security & Manageability
  • Message Exchange Patterns
  • Service Consumer Patterns
  • Composition Patterns

Part II – Applying SOA Patterns

  • Service Anti Patterns
  • Putting it all together – a case study
  • SOA vs. the World

All in all the book is worth the effort and does a good job of linking problems with solutions, regardless of whether you are a “SOA virgin” og an experienced developer/architect.

Posted in Miscellaneous | Tagged | Leave a comment