hands-on lab

Desired State Configuration of Azure VMs using Azure Machine Configuration

Difficulty: Beginner
Duration: Up to 1 hour
Students: 345
Rating: 4.7/5
On average, students complete this lab in25m
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Azure Machine Configuration provides a built-in way to evaluate and enforce operating system settings by using code-based definitions. The definitions are created using PowerShell Desired State Configuration (DSC) and delivered to Azure virtual machines through the Machine Configuration extension. Both Windows and Linux operating systems are supported. It supports both native Azure virtual machines and Azure Arc–enabled servers, extending governance beyond Azure resources into the guest OS itself.

Azure Machine Configuration integrates with Azure Policy to provide continuous assessment and enforcement of the desired state. This allows administrators to define policies that ensure virtual machines remain compliant with organizational standards and automatically remediate any deviations from the defined configurations. Azure Policy includes built-in guest configurations for common scenarios, and it also allows for the creation of custom configurations to meet specific requirements.

In this hands-on lab, you will walk through onboarding a VM for configuration management with Azure Machine Configuration and apply a custom DSC configuration to install and configure a web server.

Learning Objectives

Upon completion of this beginner-level lab, you will be able to:

  • Prepare Azure Machine Configuration Dependencies
  • Assign guest configurations to onboarded VMs
  • Understand how Azure Machine Configuration works with Azure Policy

Intended Audience

  • Cloud Architects
  • Data Engineers
  • DevOps Engineers
  • Software Engineers

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • PowerShell DSC on Windows
  • Azure Virtual Machine

The following labs can be used to fulfill the prerequisites:

Updates

December, 16th, 2025 - Updated lab to use Azure Machine Configuration which replaces Azure Automation State Configuration

Environment before

Environment after

Covered topics

Hands-on Lab UUID

Lab steps

0 of 4 steps completed.Use arrow keys to navigate between steps. Press Enter to go to a step if available.
  1. Logging in to the Microsoft Azure Portal
  2. Preparing Azure Machine Configuration Dependencies
  3. Configuring the VM with Azure Machine Configuration
  4. Reviewing Azure Policy Configurations for Azure Machine Configuration