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.
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:
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:
Follow these steps to create the correct Virtual Network:
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:
When the VM is deployed you can connect to the console by clicking on the appropriate button:
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:
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:
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:
Note that you could click on the JSON tab for detailed information.
Now the VM is configured correctly for Domain Controller services and you can start installing the services.
The server is now an Active Directory Domain Controller.
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:
Follow these steps to add the reverse lookup zone:
When the creation is done (immediately) create a PTR record for the domain controller. Follow these steps:
Now the pointer record is created and you can continue to check the result of the installation.
From Server Manager you can start several AD related management tools:
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:
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