Desired State Configuration In Microsoft Azure

Azure Automation Desired State Configuration allows you to deploy, monitor, and automatically update the desired state of all your IT resources consistently.
  • Azure DSC is built on PowerShell DSC. It was the new feature of PowerShell 4.0 on Windows Server 2012 R2.
  • Azure Desired State Configuration is the declarative PowerShell script which describes the configuration state of one or multiple machines.
  • Azure Automation Desired State Configuration can align the machine configuration with a specific state across the physical and virtual machine, using Windows and Linux, on-premises and in the cloud.
  • Using Azure automation DSC, one can author and manage PowerShell Desired State Configurations, import DSC resources, and generate DSC node configurations.
  • These DSC items are placed on the Azure Automation DSC pull server so that the target nodes automatically receive configurations, confirm to the desired state, and report back on their compliance.
  • Deploying and maintaining the desired state of your servers and application resources can be difficult and error-prone. Desired State configuration supports continuous deployment and prevents errors.
  • One can script one and provide a parameter for multiple environments like development, testing, and production.
  • Azure DSC allows integrated source control versioning and reporting also.
  • Azure DSC is a part of Azure Automation Service.
Configurations

  • To use DSC to configure your environment, first, define a Windows PowerShell script block using configuration keyword.
  • Inside the configuration block, you can define node configurations that specify the desired configuration for a set of nodes(computers) in your environment that should be configured the same.
  • In this way, a node configuration represents a “role” for one or more nodes to assume.
  • A node configuration block starts with the node keyword.
  • Follow this keyword with the name of the role, which can be a variable or expression.
  • After the role name, use braces {} to delimit the node configuration block.
  • Inside the node configuration block, define the resource blocks to configure and specify DSC resources. A resource block starts with the name of the resources followed by the identifier you want to specify for that block, then brces{} to delimit the block.

Node Configuration

  • When a DSC Configuration is compiled, one or more node configurations are produced depending on the Node blocks in the configuration.
  • A node configuration is same as Configuration Document.
  • Node configurations represent a “role”, such as web server or worker, which desired state one or more nodes should assume or check for compliance against.

Node

  • A DSC node is any machine that has its configuration managed by DSC.
  • This machine could be a Windows or Linux Azure VM, on-premises VM/Physical host or machine in another public cloud.
  • Nodes enact node configurations to become and maintain compliance with the desired state they define.
  • Nodes also report back to a reporting server on their configuration and compliance status.
  • When a node configuration changes happen, the node automatically assumes a different role by changing its configuration and begins reporting against its new role.

Resources 

  • DSC resources are building blocks that you can use to define a Windows PowerShell Desired State Configuration (DSC) configuration.
  • DSC comes with a set of built-in resources such as those for files and folders, server features and roles, registry settings, environment variables and services and processes.

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now