Skip to content

Latest commit

 

History

History
90 lines (77 loc) · 3.92 KB

automation-dsc-create-composite.md

File metadata and controls

90 lines (77 loc) · 3.92 KB
title description keywords services ms.service ms.subservice author ms.author ms.date ms.topic manager
Convert configurations to composite resources for Azure Automation State Configuration
This article tells how to convert configurations to composite resources for Azure Automation State Configuration.
dsc,powershell,configuration,setup
automation
automation
dsc
mgreenegit
migreene
08/08/2019
conceptual
carmonm

Convert configurations to composite resources

Applies To: Windows PowerShell 5.1

Once you get started authoring configurations, you can quickly create "scenarios" that manage groups of settings. Examples would be:

  • create a web server
  • create a DNS server
  • create a SharePoint server
  • configure a SQL cluster
  • manage firewall settings
  • manage password settings

If you are interested in sharing this work with others, the best option is to package the configuration as a Composite Resource. Creating composite resources for the first time can be overwhelming.

Note

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

Community project: CompositeResource

A community maintained solution named CompositeResource has been created to resolve this challenge.

CompositeResource automates the process of creating a new module from your configuration. You start by dot sourcing the configuration script on your workstation (or build server) so it is loaded in memory. Next, rather than running the configuration to generate a MOF file, use the function provided by the CompositeResource module to automate a conversion. The cmdlet will load the contents of your configuration, get the list of parameters, and generate a new module with everything you need.

Once you have generated a module, you can increment the version and add release notes each time you make changes and publish it to your own PowerShellGet repository.

Once you have create a composite resource module containing your configuration (or multiple configurations), you can use them 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. Then register your servers from either on-premises or in Azure to pull configurations. The latest update to the project has also published runbooks for Azure Automation to automate the process of importing configurations from the PowerShell Gallery.

To try out automating creation of composite resources for DSC, visit the PowerShell Gallery and download the solution or click "Project Site" to view the documentation.

Next steps