Skip main navigation

Hurry, only 3 days left to get one year of Unlimited learning for £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Automation DSC


Now that you have an understanding of DSC, let’s explore the architecture and automation within DSC. This step is an introduction to using DSC frameworks and how automation DSC works, and will prepare you for implementing Automation DSC.

Using DSC Frameworks

Microsoft PowerShell DSC is one of many DSC frameworks and is one of the tools you can use in your DevOps solutions. Within Microsoft PowerShell DSC, you can use DSC in pull or push modes and use the declarative phase to control the server state.

The push mode is unidirectional and immediate. This means that the configuration is pushed to its intended targets, and those targets are configured. In pull mode, each pull client machine is configured to get its desired state configuration from the pull server.

The pull server is set up to host the DSC service, and it’s provisioned with the configurations and resources required by the pull clients. Each pull client has a scheduled task that performs periodic compliance checks on the node configuration.

When the event is triggered for the first time, it causes the Local Configuration Manager (LCM) on the pull client to validate the configuration. If the pull client is not configured as desired, the LCM makes a request to the pull server to get a given configuration. If that configuration exists on the pull server and it passes validation checks, the configuration is transmitted to the pull client where it is then executed by the LCM.

Controlling the desired state can be as simple as ensuring that a file or directory exists, or something more complex such as modifying the registry, stopping or starting services, or running scripts to deploy an application. You can do this repeatedly without error. You can also define your own DSC resources or leverage many built-in resources.

DSC Use Cases

The following are some example scenarios where you can use built-in DSC resources to configure and manage a set of target nodes in an automated way.

  • Enabling or disabling server roles and features.
  • Managing files and directories.
  • Starting, stopping, and managing processes and services.
  • Deploying new software or software updates.
  • Fixing a configuration that has drifted away from the desired state.
  • Managing updates.

How does Automation DSC work?

Automation DSC allows you to author and manage PowerShell DSC Configurations, import DSC Resources, and generate DSC Node Configurations (MOF documents), all in the cloud.

To implement Automation DSC, you would:

  1. Create a Windows PowerShell script with the configuration element.
  2. Upload the script to Azure Automation and compile the script into a Managed Object Format (MOF) file. The file is transferred to the DSC pull server.
  3. Define the nodes that will use the configuration.

In the next section, we’ll look at each step in Automation DSC in detail.

Join the discussion

Can you think of an everyday example of where Automation DSC is used? Share your ideas with the group.

Use the Discussion section below and let us know your thoughts. Try to respond to at least one other post and once you’re happy with your contribution, click the Mark as complete button to move on to the next step.

This article is from the free online

Microsoft Future Ready: DevOps Development, Implementation and Azure Automation

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now