Step1: Create an Azure Automation account.
An Azure Automation account is required.
Step 2: Install the custom Desired State Configuration (DSC) extension on the virtual machines
Under the hood, and without an administrator having to remote into a VM, the Azure VM Desired State Configuration extension registers the VM with Azure
Automation State Configuration.
Step 3: Onboard the virtual machines to the Azure Automation account.
Step 4: Compile the Desired State Configuration (DSC) configuration.
Create a DSC configuration and compile it.
Reference:
https://docs.microsoft.com/en-us/azure/automation/automation-dsc-onboarding