Convert configurations to composite resources

Applies to: ✔️ Windows PowerShell 5.1

Note

Before you enable Automation State Configuration, we would like you to know that a newer version of DSC is now generally available, managed by a feature of Azure Policy named guest configuration. The guest configuration service combines features of DSC Extension, Azure Automation State Configuration, and the most commonly requested features from customer feedback. Guest configuration also includes hybrid machine support through Arc-enabled servers.

Important

This article refers to a solution that is maintained by the Open Source community and support is only available in the form of GitHub collaboration, not from Microsoft.

This article, explains on creating scenarios that manage groups of settings, after you get started with authoring configurations. Listed below are few examples:

  • Create a web server
  • Create a DNS server
  • Create a server that runs SharePoint
  • Configure a SQL cluster
  • Manage firewall settings
  • Manage password settings

We recommend that you package the configuration as a Composite Resource before you share it with others as creating composite resources for the first time can be a tedious effort.

Community project - CompositeResource

A CompositeResource is a community maintained solution that has been created to resolve this challenge. Composite Resource automates the process of creating a new module from your configuration.

Create a composite resource module

Follow the steps to create a composite resource module:

  1. Begin by dot sourcing the configuration script on your workstation (or build server) to ensure that it is loaded in memory.
  2. Use the function provided by the CompositeResource module to automate a conversion instead of running the configuration to generate a MOF file. Here, the cmdlet will load the contents of your configuration, gets the list of parameters, and generates a new module.
  3. After you generate a module, you can increment the version and add release notes each time you make changes and publish it to your own PowerShellGet repository.
  4. Use the module in the Composable Authoring Experience in Azure, or add them to DSC Configuration scripts to generate MOF files and upload the MOF files to Azure Automation.
  5. Register your servers from either on-premises or in Azureto pull configurations.

Note

The latest update to the project has also published runbooks for Azure Automation to automate the process of importing configurations from the PowerShell Gallery.

For more information on how to automate the creation of composite resources for DSC, see PowerShell Gallery and download the solution or select Project Site to view the documentation.

Next steps