Skip to the content.

Configuration Specification Command

Tips For the PowerShell newbies, you can then get detailed help on an individual command via a PowerShell command similar to:

Get-Help -Name Merge-ConfigurationSpecification -Detailed

The Dsl.Configuration PowerShell module provides one single command to process XML configuration specification DSL files:

Merge-ConfigurationSpecification -Path <string[]> [-ConfigurationFileResolver <IConfigurationFileResolverStrategy[]>] [-CreateBackup] [-CreateUndo] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

Where

Remark No backup will be performed nor an undo specification generated should the merge of a configuration specification would not result in any changes to an XML configuration file.

Configuration Specification DSL

The configuration specification DSL is an embedded XML DSL. As the following example illustrates, a configuration specification deceptively looks like an actual XML configuration file:

<configuration xmlns:config="urn:schemas.stateless.be:dsl:configuration:annotations:2020"
               config:targetConfigurationFiles="global:clr4:machine.config">
  <system.serviceModel>
    <extensions>
      <behaviorExtensions>
        <add
          name="propertyPropagator"
          type="Be.Stateless.BizTalk.ServiceModel.Configuration.PropertyPropagationBehaviorExtension, Be.Stateless.BizTalk.ServiceModel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3707daa0b119fc14"
          config:operation="insert"
          config:key="name" />
      </behaviorExtensions>
    </extensions>
  </system.serviceModel>
  <system.web>
    <applicationPool
      maxConcurrentRequestsPerCPU="5000"
      maxConcurrentThreadsPerCPU="0"
      requestQueueLimit="5000"
      config:operation="update"
      config:key="name"
      config:scrap="maxConcurrentThreadsPerCPU, requestQueueLimit" />
  </system.web>
</configuration>

What distinguishes a configuration specification from an actual XML configuration lies in the following attributes:

Remark The annotation attributes which are specific to the configuration specification DSL are naturally left off during the processing of a specification and not merged into the targeted XML configuration files.

Configuration Specification Idempotence

Configuration specification are idempotent, in the sense that if a specification has already been successfully processed —i.e. merged into its target XML configuration files,— it should not fail if its processing is triggered again. In other word, if an XML configuration file has already undergone the successful merge of a configuration specification, this XML configuration file will not be altered in any new way should the same configuration specification be merged into again.

To that end, each operation defines and implements its own preserving notion of idempotency. Details about the algorithm applied during the merge of a configuration specification for each of the operations is given by the developer help of the `ConfigurationElement.Apply’ method, but roughly speaking, each operation behave according to the following principles:

Remark A configuration element is said to correspond to its specification element when both have the same name and both are located at the same relative place in their own respective XML infoset —in other words, when both elements have the same XPath location,—see SpecificationElement.IsSatisfiedBy method.
A configuration element is said to be equivalent to its specification element when it corresponds to this specification element and that for each of the specification attributes there is an configuration attribute having both the same name and value. By default, all the specified attributes are taken into account for determining the equivalence of the elements, but only those attributes listed in the key annotation are taken into account should this annotation be specified, see SpecificationElement.IsEquatedBy method.

Configuration File Monikers and Resolvers

The Dsl.Configuration PowerShell module provides two implementations of the IConfigurationFileResolverStrategy interface:

The Dsl.Configuration PowerShell module will always append these two resolvers, ClrConfigurationFileResolverStrategy and ConfigurationFileResolverStrategy, in that order, to the list of custom object instances passed as arguments to the ConfigurationFileResolver command parameter.

When used throughout the BizTalk.Deployment PowerShell module, a third implementation of the IConfigurationFileResolverStrategy interface is always added before the preceding two resolvers:

Given that ordered list of custom and built-in XML configuration file moniker resolvers, the processing engine will only use the first resolver in this ordered list that can resolve a configuration file moniker and all the subsequent resolvers in the list will be ignored.