Onboard a machine to Automanage with an Azure Resource Manager (ARM) template

Overview

Follow the steps to onboard a machine to Automanage Best Practices using an ARM template.

Prerequisites

ARM template overview

The following ARM template will onboard your specified machine onto Azure Automanage Best Practices. Details on the ARM template and steps on how to deploy are located in the ARM template deployment section.

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "machineName": {
            "type": "String"
        },
        "configurationProfileName": {
            "type": "String"
        }
    },
    "resources": [
        {
            "type": "Microsoft.Compute/virtualMachines/providers/configurationProfileAssignments",
            "apiVersion": "2022-05-04",
            "name": "[concat(parameters('machineName'), '/Microsoft.Automanage/default')]",
            "properties": {
                "configurationProfile": "[parameters('configurationProfileName')]"
            }
        }
    ]
}

ARM template deployment

This ARM template will create a configuration profile assignment for your specified machine.

The configurationProfile value can be one of the following values:

  • "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"
  • "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"
  • "/subscriptions/[sub ID]/resourceGroups/resourceGroupName/providers/Microsoft.Automanage/configurationProfiles/customProfileName (for custom profiles)

Follow these steps to deploy the ARM template:

  1. Save this ARM template as azuredeploy.json
  2. Run this ARM template deployment with az deployment group create --resource-group myResourceGroup --template-file azuredeploy.json
  3. Provide the values for machineName, and configurationProfileName when prompted
  4. You're ready to deploy

As with any ARM template, it's possible to factor out the parameters into a separate azuredeploy.parameters.json file and use that as an argument when deploying.

Next steps

Learn more about Automanage for Linux and Windows