1

We are configuring our VM with ARM. We use the DSC to install most of the requirements, however, installing the anti malware extension together with the DSC does not work.

We are getting the following error: Multiple VMExtensions per handler not supported for OS type 'Windows'. VMExtension 'dscExtension' with handler 'Microsoft.Powershell.DSC' already added or specified in input.

The resources look like this:

 {  
  "type":"Microsoft.Compute/virtualMachines/extensions",
  "name":"[concat(variables('vmName'),'/', 'antiMalwareExtension')]",
  "apiVersion":"[variables('api-version')]",
  "location":"[resourceGroup().location]",
  "dependsOn":[  
     "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
  ],
  "properties":{  
     "publisher":"Microsoft.Azure.Security",
     "type":"IaaSAntimalware",
     "typeHandlerVersion":"1.1",
     "settings":{  
        "AntimalwareEnabled":"true",
        "Exclusions":{  
           "Paths":"C:\\Users",
           "Extensions":".txt",
           "Processes":"taskmgr.exe"
        },
        "RealtimeProtectionEnabled":"true",
        "ScheduledScanSettings":{  
           "isEnabled":"true",
           "scanType":"Quick",
           "day":"7",
           "time":"120"
        }
     },
     "protectedSettings":null
  }


},
{  
      "type":"Microsoft.Compute/virtualMachines/extensions",
      "name":"[concat(variables('vmName'),'/', 'dscExtension')]",
      "apiVersion":"[variables('api-version')]",
      "location":"[resourceGroup().location]",
      "dependsOn":[  
         "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
      ],
      "properties":{  
         "publisher":"Microsoft.Powershell",
         "type":"DSC",
         "typeHandlerVersion":"2.9",
         "autoUpgradeMinorVersion":true,
         "settings":{  
            "ModulesUrl":"[parameters('dscLocation')]",
            "ConfigurationFunction":"[parameters('dscFunction')]",
            "Properties":{  
               "nodeName":"[variables('vmName')]"
            }
         }
      }
Identity
  • 1,553
  • 1
  • 22
  • 44

1 Answers1

1

When looking to your template the 2 extensions are executed at the same time. Add a dependsOn to one of them:

  "dependsOn":[  
     "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]",
     "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'),'/extensions/', 'antiMalwareExtension')]"
  ],
Venkata Dorisala
  • 4,783
  • 7
  • 49
  • 90
Peter
  • 27,590
  • 8
  • 64
  • 84