Microsoft Azure Review

Active Directory in Azure – Step by Step

Ever since Windows Azure Infrastructure Services were announced in preview I keep hearing questions "How to run Active Directory in Azure VM? And then join other computers to it". This article assumes that you already know how install and configure Active Directory Directory Services Role, Promote to Domain Controller, join computers to a Domain, Create and manage Azure Virtual Networks, Create and manage Azure Virtual Machines and add them to Virtual Network.

Disclaimer: Use this solution at your own risk. What I describe here is purely my practical observation and is based on repeatable reproduction. Things might change in the future.

The foundation pillar for my setup is the following (totally mine!) statement: The first Virtual Machine you create into an empty Virtual Network in Windows Azure will get the 4th IP Address in the sub-net range. That means, that if your sub-net address space is, the very first VM to boot into that network will get IP Address The given VM will always get this IP Address across intentional reboots, accidental restarts, system healing (hardware failure and VM re-instantiating) etc., as long as there is no other VM booting while that first one is down.

First, lets create the virtual network. Given the knowledge from my foundation pillar, I will create a virtual network with two separate addressing spaces! One addressing space would be This will be the addressing space for my Active Directory and Domain Controller. Second one will be Here I will add my client machines.

Next is one of the the most important parts – assign DNS server for my Virtual Network. I will set the IP Address of my DNS server to! This is because I know (assume) the following:

  • The very first machine in a sub-network will always get the 4th IP address from the allocated pool;
  • I will place only my AD/DC/DNS server in my AD Designated network;

Now divide the network into address spaces as described and define the subnets. I use the following network configuration which you can import directly (however please note that you must have already created the AffinityGroup referred in the network configuration! Otherwise network creation will fail):

01 <NetworkConfiguration
02   xmlns:xsd=""
03   xmlns:xsi=""
04   xmlns="">
05   <VirtualNetworkConfiguration>
06     <Dns>
07       <DnsServers>
08         <DnsServer name="NS" IPAddress="" />
09       </DnsServers>
10     </Dns>
11     <VirtualNetworkSites>
12       <VirtualNetworkSite name="My-AD-VNet" AffinityGroup="[Use Existing Affinity Group Name]">
13         <AddressSpace>
14           <AddressPrefix></AddressPrefix>
15           <AddressPrefix></AddressPrefix>
16         </AddressSpace>
17         <Subnets>
18           <Subnet name="ADDC">
19             <AddressPrefix></AddressPrefix>
20           </Subnet>
21           <Subnet name="Clients">
22             <AddressPrefix></AddressPrefix>
23           </Subnet>
24         </Subnets>
25       </VirtualNetworkSite>
26     </VirtualNetworkSites>
27   </VirtualNetworkConfiguration>
28 </NetworkConfiguration>

Now create new VM from gallery – picking up your favorite OS Image. Assign it to sub-net ADDC. Wait to be provisioned. RDP to it. Add AD Directory Services server role. Configure AD. Add DNS server role (this will be required by the AD Role). Ignore the warning that DNS server requires fixed IP Address. Do not change network card settings! Configure everything, restart when asked. Promote computer to Domain Controller. Voilà! Now I have a fully operations AD DS + DC.

Let's add some clients to it. Create a new VM from gallery. When prompted, add it to the Clients sub-net. When everything is ready and provisioned, log-in to the VM (RDP). Change the system settings – Join a domain. Enter your configured domain name. Enter domain administrator account when prompted. Restart when prompted. Voilà! Now my new VM is joined to my domain.

Why it works? Because I have:

  • Defined DNS address for my Virtual Network to have IP Address of

  • Created dedicated Address Space for my AD/DC which is

  • Placed my AD/DC designated VM in its dedicated address space

  • Created dedicated Address Space for client VMs, which does not overlap with AD/DC designated Address Space

  • I put client VMs only in designated Address Space (sub-net) and never put them in the sub-net of AD/DC

Of course you will get same result if with a single Address Space and two sub-nets. Being careful how you configure the DNS for the Virtual Network and which sub-net you put your AD and your Client VMs in.

This scenario is validated, replayed, reproduced tens of times, and is being used in production environments in Windows Azure. However – use it at your own risk.

**Disclosure: I am a real user, and this review is based on my own experience and opinions.
More Microsoft Azure reviews from users
...who work at a Computer Software Company
...who compared it with Amazon AWS
Learn what your peers think about Microsoft Azure. Get advice and tips from experienced pros sharing their opinions. Updated: April 2021.
476,483 professionals have used our research since 2012.
Add a Comment