
Create a virtual machine template with SharePoint in Windows Azure
- Tutorial

As you know, the new version of Windows Azure has the ability to use virtual machines. In particular, these can be machines with SharePoint 2010.
By default, there is no machine with SharePoint 2010 in the list of systems. We will consider how this can be fixed.
Get access to Windows Azure
A 90-day free trial is currently available .
You can also get access if you are a member of the MSDN, Microsoft Partner Network, or BizSpark programs. Details here .
Create a Windows Server Machine
First, create a virtual network according to the official guide .
Next, go to the Networks section (Fig. 1) and remember the name Affinity Group , which is useful when creating a virtual machine.

Fig. 1. Network section on the Windows Azure portal
Click on the New button at the bottom of the portal. Then Virtual Machine and From Gallery (Fig. 2)

Fig. 2. Creating a virtual machine from the gallery
Next, in the gallery, select Windows Server 2008 R2 (Fig. 3)

Fig. 3. Choosing a virtual machine template
After selecting a template, proceed to the next step by clicking on the arrow at the bottom. Specify the parameters of the virtual machine (Fig. 4)

Fig. 4. Virtual machine settings
After that, proceed to the next step, where you need to select the virtual machine mode (Fig. 5).

Fig. 5. Select virtual machine mode
as the type, select a standalone virtual machine (Standalone Virtual Machine), enter the DNS name, Storage Account (if you created earlier), and a network which will run the virtual machine.
The last step is to create an Availability Set (Figure 6). Availability Set - a group of geographically distributed virtual machines that duplicate an existing machine. Leave the default value.

Fig. 6. Availability Set
You can only use a newly created machine after its status becomesThe Running .
Install SharePoint 2010
I will not dwell on installing SharePoint 2010 in detail, since all this has already been done, and more than once.
We will use sysprep to prepare the machine . And to make it work, you need to remember about 2 conditions (according to KB 2728976 )
- DO NOT run the SharePoint Configuration Wizard (PSConfig) immediately after installing SharePoint;
- You do NOT need to install SharePoint 2010 offline (databases and SharePoint on the same machine).
You can also install Service Pack 1 for SharePoint and all necessary updates.
Create an image based on a virtual machine
As mentioned above, we will use sysprep, for which we need to type in the command line.
%WINDIR%\system32\sysprep\sysprep.exe /oobe /generalize /shutdown
After that, go to the Virtual Machines section on the Azure management portal . After that, wait for the machine to stop completely and click on Capture (Fig. 7)

. 7.
Virtual Machine Control Panel In the window that appears (Fig. 8), specify the name of the image and check the box that sysprep was running on the virtual machine.

Fig. 8. VM image settings
We use a template for creating virtual machines
Once the template is ready, you can create new machines based on it. The steps for creating are similar to those described above, but there is one difference - when choosing a template, go to the Images section and select a template prepared earlier (Fig. 9) Fig. 9

. Choosing your own virtual machine template
Thus, we looked at the process of creating a virtual machine template with SharePoint 2010.