Building a ConfigMgr Lab In Azure

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.

https://azure.microsoft.com/en-us/services/devtest-lab/

‘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;

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
  1. 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.
  2. Once you have an account setup, login to the portal via https://portal.azure.com/
  3. In the search bar, enter DevTest labs and open the marketplace.

    step3

  4. 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.

    step4

  5. You will be redirected back to the portal page, you will need to monitor the progress of the DevTest creation

    step5
    step6

  6. 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).

    step7

    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.

    step8.png

  7. 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.

    step9

    Enter your details and save.

  8. 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.

    step10

    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.

  9. Next, select ‘Artifacts’. Search for ‘Create Domain’ and select it. Click Ok.

    step11

  10. Name your domain, and select the recovery password (Secret).

    step12

    Click Ok.

  11. You should now see ‘1 artifact selected’. Click create

    step13

    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.

    step14

  12. We now need to deploy the solution. From the DevTest homepage navigate to ‘All Virtual Machines’ and select ‘Add’.

    1

    Select your base ‘Active Directory’

    2

    Give the virtual machine a name, e.g ‘DC1’. Click create to deploy the DC1 virtual machine.

    3

    You will be notified of the progress of the deployment.

    4

    Deployment progress can also be monitored from the DevTest homepage.

    5

    6]

  13. 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.

    step15

  14. 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.

  15. 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.

    step16

    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.

    step17

    You should now see two Formulas.

  16. 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.

  17. 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.

    789

  18. 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.

    10

  19. 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.

    iexplore_2018-04-13_17-04-35

    Select ‘custom’ and input the IP address of your Domain Controller. Save the configuration.

  20. 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.

    13

    14

  21. 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.

    0

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.

Cheers,

Dan

 

Advertisement

One thought on “Building a ConfigMgr Lab In Azure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s