Compose DSC configurations

When you need to manage resource with more than a single desired state configuration (DSC), the best path is to use composite resources. A composite resource is a nested and parameterized configuration being used as a DSC resource within another configuration. Use of composite resources allows you to create complex configurations while allowing the underlying composite resources to be individually managed and built.

Azure Automation enables the import and compilation of composite resources. Once you've imported composite resources into your Automation account, you can use Azure Automation State Configuration through the State Configuration (DSC) feature in the Azure portal.

Compose a configuration

Before you can assign a configuration made from composite resources in the Azure portal, you must compose the configuration. Composition uses Compose configuration on the State Configuration (DSC) page while on either the Configurations or the Compiled configurations tab.

  1. Sign in to the Azure portal.
  2. On the left, click All resources and then the name of your Automation account.
  3. On the Automation account page, select State configuration (DSC) under Configuration Management.
  4. On the State configuration (DSC) page, click either the Configurations or the Compiled configurations tab, then click Compose configuration in the menu at the top of the page.
  5. On the Basics step, provide the new configuration name (required) and click anywhere on the row of each composite resource that you want to include in your new configuration, then click Next or click the Source code step. For the following steps, we selected PSExecutionPolicy and RenameAndDomainJoin composite resources. Screenshot of the basics step of the compose configuration page
  6. The Source code step shows what the composed configuration of the selected composite resources looks like. You can see the merging of all parameters and how they are passed to the composite resource. When you are done reviewing the new source code, click Next or click the Parameters step. Screenshot of the source code step of the compose configuration page
  7. On the Parameters step, the parameter for each composite resource is exposed so that values can be provided. If a parameter has a description, it is displayed next to the parameter field. If a parameter is of PSCredential type, the dropdown provides a list of Credential objects in the current Automation account. A + Add a credential option is also available. Once all required parameters have been provided, click Save and compile. Screenshot of the parameters step of the compose configuration page

Submit the configuration for compilation

Once the new configuration is saved, it is submitted for compilation. You can view the status of the compilation job like you do with any imported configuration. For more information, see View a compilation job.

When compilation has completed successfully, the new configuration appears in the Compiled configurations tab. Then you can assign the configuration to a managed node, using the steps in Reassigning a node to a different node configuration.

Next steps