Managing VM Configurations with Azure Automation DSC

When it comes to deploying and maintaining a consistent configuration across multiple servers, things can get tedious rather quickly.  With so much manual work involved, it can also be rather error-prone as well.  To address these issues in the datacenter, Microsoft originally introduced Desired State Configuration (DSC).  However, DSC is now also available in Azure and it’s called Azure Automation Desired State Configuration.

With Azure Automation Desired State Configuration, IT professionals can rollout and maintain consistent configurations across all Windows or Linux servers deployed.

In this tutorial, I am going to walk you through the process of deploying Azure Automation Desired State Configuration and using it to ensure a consistent configuration of servers it is applied to.

I’ll start by authoring a small PowerShell Desired State Configuration that ensures the File Services features are installed on any server it is applied to.  This configuration script will be imported into Azure as a DSC Resource and used to generate a DSC Node Configuration (MOF document) that resides in Azure.

Once I have the configuration items built and imported into Azure, I’ll place them on an Azure Automation DSC Pull Server so that my virtual machines in Azure automatically receive the configuration and automatically re-apply the configuration if it happens to be manually removed from the server.

Azure Automation can target physical machines and virtual machines – in the cloud or on-prem.  In my tutorial below, I’ll be using a virtual machine in Azure as my target.

Creating the DSC Script

Before I can give Azure Automation DSC a whirl, I’m going to need a DSC script to use. For this exercise, I’ll use a basic script that just checks for the presence of the File Services feature.  If it’s not installed, it’s installed automatically by DSC.

Click here to join the Understanding Azure Facebook group or here for the latest Azure practice questions, answers, explanations, and reference materials.

Thomas Mitchell

Tom is a 20+ year veteran of the IT industry and carries numerous Microsoft certifications, including the MCSE: Cloud Platform and Infrastructure certification. A Subject Matter Expert in Active Directory and Microsoft Exchange, Tom also possesses expert-level knowledge in several other IT disciplines, including Azure, Storage, and O365/Exchange Online. You can find Tom at his website, on LinkedIn, or on Facebook. Need to reach him by phone? Call 484-334-2790.