Define and Enforce Desired States with ARM, Bicep, and DSC
Azure Resource Manager (ARM) and Bicep are the primary tools for defining Azure infrastructure in a declarative way. ARM templates (JSON) and Bicep files let you specify what resources should exist rather than the steps to create them, ensuring consistent and repeatable deployments across environments. Together with Desired State Configuration (DSC) and Azure Automation State Configuration, you can also enforce the configuration of virtual machines. Azure Automanage Machine Configuration extends this by automatically detecting and fixing configuration drift, though the core focus of this section is on ARM, Bicep, and DSC.
ARM Templates
ARM templates are JSON files that declare the infrastructure and configuration for Azure services. Because they use a declarative syntax, you describe the target state—such as virtual machines, networks, and storage accounts—and ARM handles the order of operations. This approach delivers consistency across environments, removes manual steps, and integrates easily with CI/CD pipelines for automated deployments.
Bicep
Bicep is a domain-specific language that simplifies authoring compared to raw JSON. It still uses the same ARM template engine under the hood; Bicep files are transpiled (converted) into ARM templates during deployment. Key advantages include easier syntax, support for reusable modules, and direct conversion to ARM for straightforward troubleshooting. This makes Bicep a more user-friendly choice for teams adopting infrastructure as code.
Desired State Configuration (DSC)
DSC is a management framework built into Windows PowerShell that ensures components in an environment stay in a predefined state. It works on both Windows and Linux virtual machines. You write configuration scripts that define the desired state, and DSC continuously checks and enforces compliance. If a machine drifts from the configuration (for example, a service stops or a setting changes), DSC can automatically remediate it. This gives you central control over thousands of nodes.
Azure Automation State Configuration
Azure Automation State Configuration provides a cloud-based pull server that enhances DSC. Instead of each node managing its own configuration, you assign configurations to target nodes from a central Azure Automation account. The nodes pull the configuration and report compliance. This service scales to thousands of machines, simplifies management across cloud and on-premises servers, and integrates with Azure Monitor to send compliance data for central tracking.
Conclusion
By combining ARM templates or Bicep for infrastructure deployment with DSC for ongoing configuration enforcement, you create a robust infrastructure-as-code practice. ARM and Bicep handle the resource provisioning, while DSC and Azure Automation State Configuration maintain the desired state of the machines. Together, these tools reduce manual configurations, improve compliance, and enable scalable, repeatable environment management.