Part 2: Create Virtual Machines and Active Directory

In previous post, Part 1: Creating Azure Network and Storage, we set up your Azure account ready for two virtual machines that’ll be the backbone of your own testing environment. One of these servers will run the Active Directory and the other one will host your SQL Server 2012 instance. The Active Directory server is really optional, you can do a test environment without it but I prefer test environments that mimic the production.

Go to Virtual Servers and choose Create A Virtual Machine.

azure_create_vm

For the Active Directory server we can use Compute / Virtual Machine and From Gallery option. I choose Windows 2008 R2 server from the list, since this is what most of our environments are running at the time.

azure_gallery_create

I don’t need all that much resources on, so I chose Small size. I wanted the latest version and choose the latest Version Release Date available. Then give the server a name, an administrator account you wish to use and complex enough password and you’re good to go to next step.

azure_vm_config

In the next page I choose the virtual network we created before, it has only one subnet in it so there’s no choice there. We also choose the Storage Account we created in Part 1 of this guide.

azure_vm_config2

Finally we set up the Endpoints we want to use for accessing our almost created virtual machine. By default it’ll offer Remote Desktop and Powershell. You can use Auto for Public Port on Remote Desktop, but I’ve had some instances where I’ve had to set to same as the Private Port to be able to connect. Just click on the icon in right bottom corner and you’re all set!

azure_vmnet_config

While the server is being provisioned, you can go and add another server following the instructions above. Just choose the Windows and SQL Server combination from the Gallery you want to build your test environment on. For my own test environment, I went with Windows Server 2012 with SQL Server 2012 Standard Edition. I did pick the Medium sized box for the extra CPU core.

Creating Active Directory

Once your servers are up and running, you can connect to them by using Remote Desktop just like any other server you have running in your own network. The first thing we’ll do is to create the Active Directory and we’ll do it by logging into our brand new Windows 2008 R2 server.

From my opinion, the easiest way to do this is to open up an elevated (Run as Administrator) Command Prompt and enter the command “dcpromo”. This will check if you have the Active Directory Services binaries installed, if you don’t have them, it’ll install them for you.

azure_dcpromo

Once the binaries are installed it’ll fire up the Active Directory Domain Services Installation Wizard. This tool is used for creating the Active Directory itself. For test environment, I’ll just go with the defaults on this page.

azure_adwiz1

An Operating System Compatibility message will come up, but since we’re not going to run any older versions of Windows in this environment we’ll just click Next. In the Choose a Deployment Configuration page, we’ll need to select “Create a new domain in a new forest” option, since this is our first Active Directory server. Then click Next to proceed.

azure_adwiz2

In the next page, you’ll need to give fully qualified domain name (FQDN) for your Active Directory root domain. Once you’ve come up with a proper name you’d like to use, click Next.

azure_adwiz3

On the page called Set Forest Functional Level, you need to make a decision on what is the functional level of your AD. This will affect the available features for your Active Directory, I chose the highest possible for all of the supported features. After you click Next, a windows will pop-up saying: “Examining DNS configuration.”

Since we didn’t set up any DNS services before running dcpromo, we’re now prompted to add that as an additional option to our domain controller. So click Next to continue with the installation.

azure_adwiz4

A warning will come up saying that the computer has dynamically assigned IP-addresses. In test environment, I’ll just go with it and pick the not recommended option. You will get another warning about DNS Server delegation and a prompt to continue, choose Yes.

azure_adwiz5

The next page will ask for location for database and log files as well as location for SYSVOL. For a test environment the defaults will do just fine.

azure_adwiz6

After clicking next, it’ll ask for Directory Services Restore Mode Administrator Password (write this down somewhere, in case you do something unexpected to your AD). Click Next to get to Summary window. If everything here is as you wanted, click Next again and it’ll start configuring your Active Directory.

It’ll take couple minutes for the configuration to complete, after which you’ll see a following window.

azure_adwiz7

And that’s it, you now have Active Directory set for your test environment! Click Finish to close the Installation Wizard, then choose Restart Now.

Note! After making server a Domain Controller for your Active Directory, the local user accounts no longer exist. So change your login domain to whatever you decided to call your Active Directory when prompted for username and password. Then all that is left, is to set up your SQL Server, which we’ll cover in the next part.

Other articles for this series:

Part 1: Create Azure Network and Storage
Part 3: Setup your SQL Server for testing purposes.

Author: Mika Sutinen

Hi, My name is Mika Sutinen and I'm a Senior Database Administrator for a company called Tieto. I've been working in IT-industry for two decades and I've spend most of my career working with healthcare information systems. I've worked with SQL Server for most of my career, starting with version 6.5 a long, long time ago. My other interests are high availability, everything related to performance (testing, monitoring, etc), Windows operating systems and I'm currently learning more about Azure.

3 thoughts on “Part 2: Create Virtual Machines and Active Directory”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s