AutoManage bicep module assistance

John Pala 5 Reputation points
2023-10-26T02:38:50.4533333+00:00

Hi,

I converted the arm template into bicep from the link below, entered the machinename & configurationprofilename parameters and it works and I am able to deploy things.

https://learn.microsoft.com/en-us/azure/automanage/arm-deploy.

I'm struggling to understand how to create a module from this.

How would I go about referencing the name from the automanage module, I'm not really sure.

Any assistance would be appreciated

  name: '${machineName}/Microsoft.Automanage/default'

Environment

/modules/automanage.bicep

param machineName string
param configurationProfileName string 

resource machineName_Microsoft_Automanage_default 'Microsoft.Compute/virtualMachines/providers/configurationProfileAssignments@2022-05-04' = {
  name: '${machineName}/Microsoft.Automanage/default'
  properties: {
    configurationProfile: configurationProfileName
  }
}

/env/automanage/automanage.bicep

param machineName string
param configurationProfileName string 

module automanage 'modules/automanage.bicep' = {
  name: 
  params: {
    configurationProfileName: configurationProfileName
    machineName: machineName
  }
}

/env/automanage/parameters.json

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "machineName": {
      "value": "avddc01"
    },
    "configurationProfileName": {
      "value": "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesDevTest"
    }
  }
}

Azure Automanage
Azure Automanage
An Azure service designed to simplify IT management with optimized, automated operations across the lifecycle of virtual machines.
20 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. John Pala 5 Reputation points
    2023-10-26T03:24:41.8766667+00:00

    I figured this out.

    Name, is the deployment name itself and does not reference the module

    name: 'deploy_automanage_${machineName}'