0
votes

I'm trying to provision two Azure Virtual Machine Extensions, that have parameters associated to them:

  1. Microsoft Antimalware
  2. Site24x7 Agent for Windows Server Monitoring

I could not find much documentation, but I tried to extract the data from the azure portal under Automation script to see how it was setup in JSON template.

resource "azurerm_virtual_machine_extension" "test1" {
name                 = "IaaSAntimalware"
location             = "${azurerm_resource_group.test.location}"
resource_group_name  = "${azurerm_resource_group.test.name}"
virtual_machine_name = "${azurerm_virtual_machine.testapp.name}"
publisher            = "Microsoft.Azure.Security"
type                 = "IaaSAntimalware"
type_handler_version = "1.5.5.1"
auto_upgrade_minor_version = "true"

settings = <<SETTINGS
    {
        "AntimalwareEnabled": true,
        "RealtimeProtectionEnabled": "true",
        "ScheduledScanSettings": {
            "isEnabled": "true",
            "day": "1",
            "time": "120",
            "scanType": "Quick"
            },
        "Exclusions": {
            "Extensions": "",
            "Paths": "",
            "Processes": ""
            }
    }
SETTINGS

tags {
    environment = "${var.tag_env}" }
}

Azure Portal Configuration for Antimalware Extension

azurerm_virtual_machine_extension.test1: 1 error(s) occurred:`

azurerm_virtual_machine_extension.test1: compute.VirtualMachineExtensionsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidParameter" Message="The value of parameter typeHandlerVersion is invalid."

Does anyone know the proper syntax?

1
I'm also trying the same thing with Site24x7 Agent: ` "settings": { ` "site24x7AgentType": "azurevmextnwindowsserver" }, "protectedSettings": { "site24x7LicenseKey": " } }Parvez

1 Answers

0
votes

If you look at this line in the anti-malware-extension-windows-vm sample of azure-quickstart-templates: "typeHandlerVersion": "1.1", you see that you are passing the wrong value for the version.