If you follow my posts on Petri, you’ll know that this isn’t the first time I’ve covered automating deployment of Active Directory (AD) in Azure. In 2014 and 2015, I looked at using PowerShell to deploy AD domain controllers (DCs) in Azure. Provision Domain Controllers in Azure using PowerShell on Petri was my first attempt at a PowerShell script. A year later, I improved the script somewhat in Automate Domain Controller Deployment in Microsoft Azure.
At the beginning of last year, I wrote about using Azure Resource Manager (ARM) templates to achieve the same goal in a three-part series:
Deploy Active Directory and Certificate Services in Azure Using Infrastructure-as-Code — Part 1
Deploy Active Directory and Certificate Services in Azure Using Infrastructure-as-Code — Part 2
Infrastructure-as-Code Part 3: Deploy Active Directory and Certificate Services in Azure
The result of that was a series of templates and PowerShell Desired Configuration Management (DSC) code that deployed a DC and a member server running AD Certificate Services. If you want to learn the ins and outs of ARM templates and Infrastructure-as-Code, it’s well worth taking a look at those articles. But the resulting deployment in Azure was over complicated because the project was based on an existing template that deploys two DCs behind a load balancer.
What I really wanted was a simple template that deploys a single DC and server joined to the domain. I could write and maintain my own ARM template to achieve that goal, but I have delved into that subject enough already and I just want a readymade solution that someone else will maintain. And ‘maintain’ is important because Azure changes quickly. Then by chance, I discovered that Microsoft has a template that does exactly what I want in the Test Lab Guide repository on GitHub.
Microsoft provides templates so that users can quickly deploy Test Lab Guide (TLG) environments. TLGs are designed to help you quickly learn about Microsoft products. You can find a list of the labs on Microsoft’s website here. There are two basic TLG templates for Azure. The 3 VM base configuration, which is a bit misleading but more on that in a moment; and a Simulated intranet for Microsoft 365 Test Lab Guides base configuration. In this article, I’ll use the 3 VM base configuration.
The 3 VM base configuration template (tlg-base-config_3-vm) deploys a DC and a member server (APP1). Optionally, the template can be used to deploy a third virtual machine (VM) running Windows 10. But if you want to deploy a client VM, you must upload a generalized Windows 10 VHD to an Azure storage account. The template doesn’t automate the client VM deployment from the Azure Gallery because Windows 10 is only available to Visual Studio and MSDN subscribers. Read the template notes page carefully if you decide to deploy a Windows 10 client.
To deploy the template in Azure, follow the steps below.
The deployment will now start. A notification will appear in the top right corner of the Azure management portal to indicate that the deployment is in progress. Once deployment has completed, you should see another notification in the management portal. In my experience, that doesn’t always happen, and you might need to refresh the site in the browser to get the notification.
But once everything is done, you can click Virtual machines on the left of the management portal and you should see DC1 and APP1. You can connect to them using the administrator username and password that you entered above.