Table of Contents

Active Directory Domain Controller in Azure

Summary: How to setup an Active Directory Domain Controller in Azure.
Date: Around 2017
Refactor: 20 February 2025: Checked links and formatting.

After starting with Getting Started With Azure you are now ready for creating your first VM in Azure and of course we'll start with a Domain Controller. I need this for a later tutorial so it's as good as any and it will touch a lot of different concepts and useful information.

The overall process consists of a few steps:

Note that this page continues from Getting Started With Azure and assumes your Azure subscription is entirely empty and never used. For this tutorial we'll use the MSDN subscription as it has a higher credit.

Create the Resource Group

Before we can create the VM we need to create the ResourceGroup that will hold the Storage Account and the Virtual Network that are required. The resource group will act as a boundary for resources that should work together:

addcinazure06.jpg


addcinazure07.jpg


Create the Storage Account

Before we can deploy a VM we need a storage account as a VM uses storage. This can be done while creating the VM but I want to create it manually for showing and learning purposes:

addcinazure05.jpg


addcinazure08.jpg


Create the Virtual Network

Follow these steps to create the correct Virtual Network:

addcinazure11.jpg


addcinazure12.jpg


Create the Virtual Machine

To create th virtual machine we will work from the from the same azure portal at https://portal.azure.com. Follow these instructions to create a VM that is suited as a Domain Controller:

addcinazure09.jpg


addcinazure10.jpg


addcinazure13.jpg


When the VM is deployed you can connect to the console by clicking on the appropriate button:

addcinazure14.jpg


Add Data Disk

The Domain Controller service cannot be installed on the OS disk as the disk should be non caching. This is not supported and can lead to very annoying problems (USN rollbacks). So now we should add a data disk to the VM:

addcinazure15.jpg


addcinazure16.jpg


Set a Static IP Address

An Active Directory Domain Controller requires a static IP address, however, whatever you do, don't do it from the VM itself as this is not supported. You should set a static IP address from within the Azure fabric, and the result can be compared to set a static IP address from a DHCP server. To do this you need PowerShell with the Azure modules installed. See AzureRM PowerShell on how to do this.

To check what your current IP address and the name of the Networkinterface is go to the Virtual Machine and select the Network interfaces:

addcinazure17.jpg


Now you are ready to set the static IP address. Log in to Azure using this command:

Login-AzureRmAccount

Now issue the following command to set the IP address:

PS C:\> $nic=Get-AzureRmNetworkInterface -Name AzureDC01772 -ResourceGroupName AzureResourceGroup01
PS C:\> $nic.IpConfigurations[0].PrivateIpAllocationMethod = "Static"
PS C:\> $nic.IpConfigurations[0].PrivateIpAddress = "10.0.0.4"
PS C:\> Set-AzureRmNetworkInterface -NetworkInterface $nic

You can check by issuing this command in Azure Powershell:

Get-AzureRmNetworkInterface -Name AzureDC01772 -ResourceGroupName AzureResourceGroup01

Inside the output check for the following lines:

                                  "PrivateIpAddress": "10.0.0.4",
                                  "PrivateIpAllocationMethod": "Static",

Or, you could check the activity log of the network interface. From the virtual machine blade, select Network Interfaces → Select the Interface you changed → Activity Log:

addcinazure18.jpg


Note that you could click on the JSON tab for detailed information.

Install Active Directory Domain Controller Services on Windows Server 2016

Now the VM is configured correctly for Domain Controller services and you can start installing the services.

addcinazure19.jpg


addcinazure20.jpg


addcinazure21.jpg


addcinazure22.jpg


addcinazure23.jpg


addcinazure24.jpg


addcinazure25.jpg


addcinazure26.jpg


addcinazure27.jpg


The server is now an Active Directory Domain Controller.

DNS Reverse Lookup Zone

By default, when installing the DNS server through the Domain Controller installation wizard the DNS service gets installed without a reverse lookup zone, which is a bad thing because this will cause DNS reverse lookups to fail. You can check this by starting Server Manager → Tools → DNS:

addcinazure30.jpg


Follow these steps to add the reverse lookup zone:

addcinazure31.jpg


addcinazure32.jpg


addcinazure33.jpg


When the creation is done (immediately) create a PTR record for the domain controller. Follow these steps:

addcinazure34.jpg


Now the pointer record is created and you can continue to check the result of the installation.

Check the Installation

From Server Manager you can start several AD related management tools:

addcinazure28.jpg


Inside Active Directory Users and Computers you can verify that the user you did the install with is added to all of the important administrator groups:

addcinazure29.jpg


Check the Installation through PowerShell

You can also check the installation by issuing these commands in an administrative PowerShell:

PS C:\Users\adminsjoerd> Get-ADDomain | fl Name,DomainMode
 
Name       : shift
DomainMode : Windows2016Domain
 
PS C:\Users\adminsjoerd> Get-ADForest | fl Name,ForestMode
 
Name       : shift.local
ForestMode : Windows2016Forest

Resources