Azure VM Deployments with DSC and Chocolatey

I kinda love deploying servers. Really I do. It’s one of the consistent parts of my job as Sysadmin over the years and generally it has resulted in great amounts of satisfaction. As a technical evangelist, I still get to deploy them all the time in Azure for various tests and a projects.  Of course, one of the duller parts of the process is software installation.  No one really enjoys watching progress bars advance, when really you want to get to the more useful “configuration” part of whatever you are planning.

Not that long ago, Sysadmins utilized a not quite magical process of imaging machines to speed this up.  The process still required a lot of waiting.  If one was doing desktop deployments, the process was only made slightly more bearable by looking at the family photos and other trinkets left on people’s desks. Depending on the year one might have been working, this imaging process was also known by the brand name of a popular software – “ghosting.” If you look up the definition of imaging or ghosting in the dictionary, you’d find that it basically meant spending hours installing and capturing the perfect combination of software only to find one or more packages out of date the next time the image is used.

At any rate, fast forward to now and for the most part, we still have to install software on our servers to make them useful. And without a doubt, there will always be another software update. But at least we have a few ways of attempting to make the software installation part of the process a little less tedious.

I’ve been working on a project where I’ve been tackling that problem with a combination of tools for deployment of a “mostly ready to go” server in Azure. The goal was to provide a single server to improve the deployment process for small gaming shops – in particular, allow for the building of a game to be triggered from a commit on GitHub. Once built, Jenkins can be configured to copy the build artifacts to a storage location for access.  For our project, we worked with the following software requirements to support a Windows game, but there is nothing stopping you from taking this project and customizing it to your own needs.

  • Windows Server with Visual Studio
  • Jenkins
  • Unity
  • Git

I’m a big fan of ARM Template deployments into Azure, since they can be easily kicked off using the Azure CLI or PowerShell. So I created a basic template that would deploy a simple network with the default Jenkins port open, a storage account and VM. The VM would use an Azure supplied image that already include the current version of Visual Studio Community. (Gotcha: Before deploying the ARM template, confirm that the Azure image specified in the template is still available. As new versions of Visual Studio are released, the image names can change.)

The template also takes advantage of the DSC extension to call a DSC configuration file to install the additional software and make some basic OS configuration changes. The DSC extension call the package from our GitHub repo, so if you plan to customize this deployment for yourself, you may want to clone our repo as a starting point.

You can find our working repo here and the documentation is a work in progress at the moment.   The key files for this deployment are:

  • BuildServerDSCconfig.ps1.zip
  • StartHere.ps1
  • buildserverdeploy.json

Use the StartHere.ps1 PowerShell file to connect to your Azure account, set your subscription details, create a destination resource group and deploy the template.  If you are more an Azure CLI type of person, there are equivalent commands for that as well.

Once you deploy the buildserverdeploy.json template, the BuildServerDSCconfig.ps1.zip is automatically called to do the additional software installations.  Because the additional software packages come from a variety of vendors, the DSC configuration first installs Chocolatey and then installs the community maintained versions of Jenkins, Unity and Git. (Creating the DSC configuration package with the BuildServerDSCconfig.ps1 is another topic, stay tuned.)

Once the deployment is complete, all that remains is for the final configuration to be set up to meet the needs of the developers.  This includes connecting to the proper GitHub repo, providing the necessary Unity credentials and licensing and creating the deployment steps in Jenkins.

Congrats!  You’ve now created an automated CI/CD server to improve your development process.

Advertisement

Every Week in the Microsoft Reactor

If you haven’t discovered the Microsoft Reactor in San Francisco, you are in for a treat.  This new community space near the Moscone Center is often available to use for meet ups and training workshops.  You can check out the event calendar for details of upcoming events.  You can also watch the new Reactor Weekly show by Tim Reilly – in this week’s episode you can learn about the pending installation of a Surface Hub and hear about some of the value of the community user groups like Pacific IT Professionals.

Some of the events I’m looking forward to this month are:

Learn Something Today from TechEd Houston

Since today is Wednesday, I’m bringing you a selection of session from Day 3 of TechEd Houston which was also a Wednesday.

  • Introduction to Microsoft Azure Automation (DCIM-B347)
  • Data Protection in Microsoft Azure (DCIM-B387)
  • How to Rapidly Design and Deploy an Active Directory Federation Services Farm: The Do’s and Don’ts (PCIT-B324)
  • Leveraging Your On-Premises Directory Infrastructure to Manage Your Microsoft Azure Active Directory Identities (DCIM-B301)
  • Mark Russinovich and Mark Minasi on Cloud Computing (DCIM-B386)
  • Deploying and Managing Work Folders (PCIT-B322)
  • Windows To Go: Deployment, Support for BYOD, and What IT Pros Need to Know (WIN-B342)
  • The Agile End-to-End Story for Developers and IT Professionals (DCIM-B358)
  • TWC: How You Can Hack-Proof Your Clients and Servers in a Day (DCIM-B372)

As you can see, Wednesday was a busy day at TechEd and I since I was working down in the Windows Client area on the expo floor I still have a lot of these to watch!

The Last Part of "Accelerate DevOps in the Cloud" on TechNet Radio

Alright everyone, all good things must come to an end.  Here is the last part of the DevOps Series on TechNet Radio.

Concluding the special “Accelerate DevOps with the Cloud” series on TechNet Radio, Keith Mayer welcomes back Jeff Fattic to the show as they discuss how Visual Studio Online can help DevOps organizations optimize the performance of their applications in Part 10.

  • [2:16] How does Visual Studio Online help organizations monitor the performance of their applications?
  • [5:16] Can Application Insights notify me proactively when performance issues are occurring?
  • [6:00]  Can Application Insights help me track and ensure availability of my deployed applications world-wide?
  • [6:32] Can Application Insights help me understand how my users are actually using my deployed applications?
  • [8:16] What about an application that is generating exceptions? Can Application Insights help my Developers and Ops teams work together to identify the issue and reduce “finger pointing”?
  • [11:08] Does Application Insights require me to deploy applications to Azure, or can I also continue to deploy some applications on-premises and still monitor them?
  • [13:12] How can I configure Application Insights for an application? Is it difficult?
  • [13:50] DEMO: Application Insights

Acclerate DevOps with the Cloud – I’m hosting Part 8 on TechNet Radio!

As promised, in part 8 of the  “Accelerate DevOps with the Cloud” series on TechNet Radio, Keith Mayer and Jennelle Crothers explore the world of roll-backs and how Microsoft Azure can streamline both the roll-back and roll-forward process for most dev teams.

  • [1:40] It seems like most dev teams spend lots of time on roll-forward plans for new code releases, but roll-backs are always a chore! Why is this?
  • [3:28] How can Azure help to streamline the roll-forward and roll-back process?
  • [8:00]  What about Virtual Machines – does Azure have anything to help with roll-forward and roll-back?
  • [9:44]  I hear a lot of “Continuous Deployment” of code releases. Isn’t that risky?
  • [13:40] DEMO: Let’s see how this is done in Azure!
Then in part 9 of the series, Keith Mayer and Yung Chou are back and discuss in depth the ability for DevOps organizations to scale up or scale down cloud applications. Tune in as they discuss Azure’s unique flexibility in terms of capacity planning for cloud applications.
·       [1:07] How is planning for application capacity different when using a cloud platform?
·       [4:50] How is scaling application capacity different or better when using the cloud?
·       [5:52]  Are there application scenarios that are particularly well-suited for scaling in the cloud?
·       [14:01]  Is there a way to trigger scaling operations automatically for applications in the cloud?
·       [15:20] DEMO: Could you show us the basics of how this all works in Azure?
o   Scaling Up Cloud Applications
o   How to Scale Out Cloud applications on a schedule
o   Auto-Scaling Cloud Applications
Only one more part to go!

Accelerate DevOps with the Cloud – Part 7 on TechNet Radio!

In part 7 of the  “Accelerate DevOps with the Cloud” series on TechNet Radio, Keith Mayer and Yung Chou welcome Sr. Program Manager Michael Greene to the show as they discuss the importance of configuration management for organizations that are starting to leverage the cloud for their daily operations. Tune in as they also demo PowerShell DSC and show us how it can be used with Azure. 
  • [2:30] When an organization is beginning to leverage the cloud, why is Configuration Management important?
  • [5:01] How is Configuration Management different from Automation?
  • [6:48]  Is Configuration Management more than just initial provisioning?
  • [10:29]  What tools and resources are available to perform Configuration Management?
  • [13:03] How does PowerShell DSC differ from PowerShell scripts?
  • [15:11] Is PowerShell DSC specific to only Windows workloads?
  • [17:23] DEMO: Can you show us how PowerShell DSC can be leveraged with Azure?

Download the PowerShell DSC Resource Kit here!

Accelerate DevOps with the Cloud – Parts 5 & 6 on TechNet Radio

In case you are curious, there are 8 parts to this TechNet Radio series, so expect 2 more.  Part 8 will be especially exciting since I’ll be the host!
In Part 5 of the  “Accelerate DevOps with the Cloud” series on TechNet Radio, Tommy Patterson welcomes Developer Technology Solutions Specialist Randy Pagels to the show as they discuss ways in which your budding DevOps organization can find effective testing methods by using Microsoft Azure and Visual Studio Online.   
  • [2:00]Why is having an effective Testing process so critical when an organization is considering their DevOps strategy?
  • [4:50] How does Visual Studio Online + Azure help to streamline and accelerate the testing process?
  • [6:00]  Performance is another area that Dev and Ops teams struggle with prior to the release of a solution, how can it be tested to determine what kind of load it can handle?
  • [8:30]  What’s the difference between test plan management in Visual Studio Online vs Visual Studio Ultimate?
  • [9:00] DEMO: Creating and walking through a web-based test plan in Visual Studio Online
Continuing the series in Part 6, Yung Chou welcomes Sr. Program Manager Charles Joy to the show as they discuss the be the importance of automation in your datacenter especially when it comes to advancing your DevOps strategy.
  • [2:36] How does automation help organizations accelerate the delivery of new solutions as they move to the Cloud?
  • [5:18] What tools and resources are available to help IT Pros get started with automation? Do they need to be a professional “scripter”?
  • [6:04]  Do IT Pros need to learn a different set of tools for automating each component?
  • [6:26]  If an IT Pro is automating cloud resources in Azure, do they have to spin up an entire set of infrastructure components just to handle automation? How does Azure automation organize and leverage these automation sequences?
  • [7:22] How can Runbooks be triggered? Based on schedule? Based on other events?
  • [8:24] Is Azure Automation extensible? Can I incorporate other PowerShell modules?
  • [9:10] DEMO: Quick walkthrough of Azure Automation accounts, assets, runbooks, schedule
Enjoy!

Accelerate DevOps with the Cloud – Part 4 on TechNet Radio!

About this Video:
In Part 4 of the  “Accelerate DevOps with the Cloud” series on TechNet Radio, Keith Mayerwelcomes Developer Technology Solutions Specialist Jeff Fattic to the show as they discuss source control in the cloud with the help of Microsoft Azure and Visual Studio Online.

  • [1:48] What is Visual Studio Online?
  • [2:32] Is Visual Studio Online only for Developers, or does it provide value to IT Pros as well?
  • [3:08]  What’s the difference between Visual Studio Online and TFS?
  • [4:28]  How can Visual Studio Online be leveraged with Microsoft Azure to help accelerate projects?
  • [7:08] How is Github different than Visual Studio Online? Are there advantages for Enterprises to use Visual Studio Online vs. Github?  
  • [9:52] What’s the single most exciting capability for you about Visual Studio Online?
  • [11:47] How can IT Organizations best get started with Visual Studio Online? Where can they go to learn more about Visual Studio Online?
  • [12:05] DEMO: Visual Studio Online in action
Check out the full series of posts and videos at http://aka.ms/DevOpsInTheCloud!

Accelerate DevOps with the Cloud – Part 3 on TechNet Radio!

In Part 3 of the  “Accelerate DevOps with the Cloud” series on TechNet Radio,  Blain Barton and Keith Mayer turn the conversation towards enabling self-service on demand Developer environments in the cloud. Learn how you can use Microsoft Azure along with System Center 2012 R2 App Controller and the Azure Pack to increase work efficiency across your organization.

  • [1:16] It seems like Dev and Test environments have been a key workload that organizations are considering for the Cloud. What do you think makes Dev/Test so attractive for the Cloud?
  • [3:44] What’s the best way to consider licensing my Developers for provisioning Dev/Test workloads on Azure?
  • [5:44]  $150/mo sounds like a great starting point, but realistically how much can a Developer really do in Azure for $150 / mo?
  • [8:04]  I’m concerned about my developers spinning up their Azure MSDN subscriptions using individual Microsoft accounts. Can I somehow link these to my organization and Active Directory?
  • [9:39] You mentioned that MSDN includes special prebuilt images for Azure? What do these images provide?
  • [11:50] If I’m using my own custom developer images in my environment, can I upload these to Azure for my developers to leverage?
  • [13:50] Lots of organizations have workloads that span on-premises and, potentially, public cloud … Does Azure provide the ability to integrate with on-premises datacenter management?
  • [16:50] DEMO: Azure Management Portal, System Center 2012 R2 App Controller, Azure Pack
Have you missed on the series so far?  Looking for the previous TechNet Radio episodes?  Find it all here!

Accelerate DevOps with the Cloud – Part 2 on TechNet Radio

Tune in with Matt Hester and Keith Mayer continue the special “Accelerate DevOps with the Cloud” series on TechNet Radio and in part 2 of our series they discuss how Microsoft Azure and cloud computing can be leveraged to help accelerate the transition to DevOps in an organization. 

  • [1:37] What is DevOps and why is it important?
  • [9:53] What is “Shadow IT” and how can it be disruptive to businesses and organizations?
  • [12:35]  What does Microsoft Azure offer me?
  • [16:19]  How does Microsoft Azure align with DevOps?
  • [21:50DEMO Microsoft Azure in action!
Did you miss Part 1 with Jessica DeVita and Gene Kim? Find it here!