How to Deploy Active Directory (AD) Domain Controller (DC) Virtual Machine (VM) in Azure with Terraform
Thousands of companies worldwide rely on Active Directory for user authentication; these companies commonly implement a few domain controllers in Azure, running on a Virtual Machine (VM) to authenticate the user and applications running on the cloud.
In this story, we will deploy two AD DCs. The first one, DC1, will create a new AD Domain Forest in the cloud, and the second one, DC2, will join this new AD Domain.
These examples will help you to create different scenarios, such as AD Domain on the cloud, hybrid AD deployments when you join existing AD on-premises, create test environments on the cloud, etc.
The code can be used to deploy one or more AD DCs, with a little code editing.
Note: for hybrid scenarios, make sure that you set the on-premises DNS on the NIC of new VMs and that there are network routes in place, or the machines will not be able to join the existing AD Domain.
Active Directory in Cloud Environments
This story is part of my Active Directory in Cloud Environments series.
I have been deploying Active Directory in AWS, Azure, GCP, and OCI cloud environments for +10 years. I…