This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Microsoft's Desired State Configuration (DSC) is a declarative configuration platform. With DSC,the state of a machine is described using a format that should be clear to understand even if thereader isn't a subject matter expert. Unlike imperative tools, with DSC the definition of anapplication environment is separate from programming logic that enforces that definition.
The DSC command line application (dsc
) abstracts the management of software componentsdeclaratively and idempotently. DSC runs on Linux, macOS, and Windows without any externaldependencies.
With DSC, you can:
DSC Configuration Documents are declarative data files that define instances of resources.Typically, configuration documents define what state to enforce. DSC supports writing configurationdocuments in both JSON and YAML.
Example scenarios include requirements for an application environment or operational/securitystandards.
DSC Resources define how to manage state for a particular system or application component.Resources describe a schema for the manageable settings of the component. Every resource can beused with theGet andTest operations to retrieve the current state of a resource instanceand validate whether it's in the desired state. Most resources also support enforcing the desiredstate with theSet operation.
Example scenarios include:
DSC differs from PowerShell Desired State Configuration (PSDSC) in a few important ways:
DSC doesn'tdepend on PowerShell, Windows PowerShell, or thePSDesiredStateConfigurationPowerShell module. DSC provides full compatibility with PSDSC resources through theMicrosoft.DSC/PowerShell
andMicrosoft.Windows/WindowsPowerShell
adapter resources.
With theMicrosoft.DSC/PowerShell
adapter resource, you can use any PSDSC resource implementedas a PowerShell class. The resource handles discovering, validating, and invoking PSDSCresources in PowerShell. The resource is included in the DSC install package for every platform.
With theMicrosoft.Windows/WindowsPowerShell
adapter resource, you can use any PSDSC resourcecompatible with Windows PowerShell. The resource handles discovering, validating, and invokingPSDSC resources in Windows PowerShell. The resource is included in the DSC install packages forWindows only.
Because DSC doesn't depend on PowerShell, you can use DSC without PowerShell installed and manageresources written in bash, Python, C#, Rust, or any other language.
DSC doesn't include a local configuration manager. DSC is invoked as a command. It doesn'trun as a service.
New DSC resources define their schemas with JSON or YAML files, not MOF files. Self-containedresources define aresource manifest that indicates how DSC should invoke the resource and whatproperties the resource can manage. For adapted resources, like those implemented in PowerShell,the adapter resource tells DSC what the available properties are for the resource and handlesinvoking the adapted resources.
Configuration documents are defined in JSON or YAML files, not PowerShell script files.Configuration documents support a subset of functionality in ARM templates, including parameters,variables, metadata, and expression functions to dynamically resolve data in the configuration.
To install DSC on any platform:
PATH
.The following commands can be used to install DSC using the publishedwinget
packages from theMicrosoft Store:
Search for the latest version of DSC:
winget search DesiredStateConfiguration --source msstore
Name Id Version Source---------------------------------------------------------------DesiredStateConfiguration 9NVTPZWRC6KQ Unknown msstoreDesiredStateConfiguration-Preview 9PCX3HX4HZ0Z Unknown msstore
Install DSC using theid
parameter:
# Install latest stablewinget install --id 9NVTPZWRC6KQ --source msstore
# Install latest previewwinget install --id 9PCX3HX4HZ0Z --source msstore
DSC is a platform tool that abstracts the concerns for defining and invoking resources. Higherorder tools, likeWinGet,Microsoft Dev Box, andAzure Machine Configuration areearly partners for DSC as orchestration agents.
DSC uses JSON schemas to define the structure of resources, configuration documents, and theoutputs that DSC returns. These schemas make it easier to integrate DSC with other tools, becausethey standardize and document how to interface with DSC.
For more information, seeDSC JSON Schema reference overview.
Was this page helpful?
Was this page helpful?