A lab in the cloud? Nice!
If you are anything like me and do not have the ability to create a Lab environment at home (those who flat share will understand) but still would like the option to test new ConfigMgr features away from your production environment, there is a quick and easy solution. Azure DevTest Labs.
‘Azure DevTest Labs helps developers and testers quickly create environments in Azure to deploy and test their applications. Easily provision Windows and Linux machines in Labs using reusable templates and artifacts while minimizing waste and controlling cost.’
Before i harp on, take a quick read of the above page. In summary DevTest Labs allow you to quickly provision a lab environment without having to go through monotonous steps you may have done 1000 times (think Domain, SQL, ConfigMgr). As the page states, some of the benefits are;
- Quickly provision development and test environments
- Minimize waste with quotas and policies
- Set automated shutdowns to minimize costs
- Build Windows and Linux environments
Now of first question on everyone’s minds when it comes to any cloud solution is cost. So, what does it cost?
Costing is outlined here, there is even a handy calculator to get a projection of what your costs may be.
The thing to consider with DevTest Labs is that they probably wont be running 24/7, so its a good idea to take that into consideration when calculating the costs. Before you start emptying out your piggy bank and thinking ‘how will I pay for this’, remember you can get a FREE azure account which includes £150 worth of credit, that should be MORE than enough to get your hands dirty and run a small lab. The great part is Azures built in Cost Management feature (which is free) so you can get handy projections on what your costs will be based on usage trends, this is extra helpful if you switch to a pay-as-you-go model.
To give you an idea on costings for this post, for setting up an entire lab environment, total cost for ~24 hrs can be seen below.
Better yet, nag your boss to pay for it and add DevTest to your companies Azure environment.
The fun part!
This post will outline creating a ConfigMgr lab environment (Current Branch or Technical Preview). We will be creating:
- A VM running ConfigMgr + SQL
- A VM with an AD Domain environment
- Relevant network resources
- The first step is to go through the azure account process, if you are setting up a free account for the first time, go here and start your trial, when you have completed the sign up process, come back here.
- Once you have an account setup, login to the portal via https://portal.azure.com/
- In the search bar, enter DevTest labs and open the marketplace.
- In the ‘Create a DevTest Lab’ input the relevant values, you will notice i use Pay-As-You-Go (i used up all my free credits long ago). Ensure you select the region closest to you. Check ‘Pin to dashboard’ to make it easier to open the resource later.
- You will be redirected back to the portal page, you will need to monitor the progress of the DevTest creation
- You will notice your DevTest Lab landing page, from this portal you will configure most of the resources for your lab. We will call this the lab ‘home page’ for now. If you pinned the DevTest to your portal page, you will find it there (or use the search function).
Navigate to the far left menu of the azure portal and select ‘All resources’ here you can see what resources the DevTest Lab has already created for us.
- The next step is to utilise the newly created Key Vault that the lab has created for us. Head back to the lab home page and navigate to ‘Secrets’. Enter an account name and strong password. This account will be used throughout the lab setup.
Enter your details and save.
- We will now need to create a Formula. A formula is a template in DevTest Labs that captures all the settings that you specify when you create a lab VM. Open the Formulas node and click ‘Add’. You will be presented with a list of ‘Bases’. From here we want to create a Formula for Active Directory, the DC (DC1) will run on Server 2016 Datacenter.
From the list of bases, select ‘Windows Server 2016 Datacenter’. This will spawn a formula creation wizard. Name the formula ‘ActiveDirectory’. Enter a memorable username and then select your saved secret. From here you will need to choose a VM template. Templates vary in cost depending on how many resources you will require, for this lab i’m selecting a fairly lean VM, the less resources the slower the solution will be to create.
- Next, select ‘Artifacts’. Search for ‘Create Domain’ and select it. Click Ok.
- Name your domain, and select the recovery password (Secret).
- You should now see ‘1 artifact selected’. Click create
You artifact will soon appear in your Lab home page. Note, this process has simply created a template (formula) to create a new VM running Server 2016 and will automatically create an AD domain (execmgr.net) for us.
- We now need to deploy the solution. From the DevTest homepage navigate to ‘All Virtual Machines’ and select ‘Add’.
Select your base ‘Active Directory’
Give the virtual machine a name, e.g ‘DC1’. Click create to deploy the DC1 virtual machine.
You will be notified of the progress of the deployment.
Deployment progress can also be monitored from the DevTest homepage.
- We will now need to create a Formula for deploying ConfigMgr. From here you can choose whether to deploy ConfigMgr Current Branch or Technical Preview, its really up to you. The formula will also deploy all of the required ConfigMgr prerequisites, (including community tools), and join our new domain.
Add a new Formula, choose Server 2016 Datacenter, this time name it ConfigMgr or ConfigMgrTP. Configure the same options as before however this time you will want to choose a higher spec machine as the VM will need to run SQL and ConfigMgr which require more resources than a simple Domain Controller.
- When selecting the artifact you will want the second ConfigMgr option if you want Technical Preview. You will be asked to supply a site code and site name. Select ‘Add’ then ‘Ok’ to choose the artifact.
- Before navigating away from artifacts you will need to add another, this time an artifact to join the ConfigMgr VM to the Domain. Open artifacts, and choose ‘Join Active Directory Domain’
Enter the requested information. Use the below example as a reference.
Once the required information has been supplied, Select ‘Add’ then ‘Ok’ to choose the artifact. You should now see two artifacts. Select Ok to go back to the home page.
You should now see two Formulas.
- Before we deploy the ConfigMgr formula, we need to gather some information from the Domain Controller, by now the Domain Controller VM should have deployed.
- Connect to the domain controller with the admin account provided in step 8 and the password configured within your initial secret (key vault). Be sure to change the login domain to match your own.
- You should now have a remote session to your new Domain Controller. Before we deploy the ConfigMgr VM we need to gather some details from the DC.
- We need to configure your Azure virtual network to allow other machines to find the domain controller. Head to your Virtual Networks (belonging to the DevTest Lab) and select DNS Servers.
Select ‘custom’ and input the IP address of your Domain Controller. Save the configuration.
- You are now ready to deploy the ConfigMgrTP virtual machine. So repeat the process from step 12. Head back to ‘All Virtual Machines’. This time select the ConfigMgrTP base and deploy it.
- The ConfigMgr VM (CM1) will now deploy. Once the VM has completed deployment it will have joined the execmgr.net domain and ConfigMgr TP will be deployed including all prerequisites.
Are we done?
If you followed all of the steps in sequence you should now have a running ConfigMgr lab once the CM1 VM has deployed. From here you will want to spin up at least one test client, to do this you would follow the same process as we just went through, at a high level this was;
- Create a formula with a base of Windows 10 – ‘client’
- Create a domain join artifact
- Create a new VM and define the new ‘client’ base.
The lab solutions are automatically set to shutdown at 7pm. You can adjust this value per VM.
From here all you really need to do is enjoy playing around with your new lab environment. As i stated before, keep an eye on your costs (and cost projections) using the built-in cost management solution.
DevTest labs are by no means limited to ConfigMgr solutions, there are endless templates you can leverage. Happy learning!
I hope you have found this post useful. Please leave any comments or questions below.
One thought on “Building a ConfigMgr Lab In Azure”