title: Terraform - Provision VM Extensions with Parameters
body: <p>I'm trying to provision two <code>Azure</code> Virtual Machine <code>Extensions</code>, that have parameters associated to them:</p>
  
  <ol>
  <li>Microsoft Antimalware</li>
  <li>Site24x7 Agent for Windows Server Monitoring</li>
  </ol>
  
  <p>I could not find much documentation, but I tried to extract the data from the azure portal under <code>Automation script</code> to see how it was setup in JSON template.</p>
  
  <pre><code>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 = &lt;&lt;SETTINGS
      {
          "AntimalwareEnabled": true,
          "RealtimeProtectionEnabled": "true",
          "ScheduledScanSettings": {
              "isEnabled": "true",
              "day": "1",
              "time": "120",
              "scanType": "Quick"
              },
          "Exclusions": {
              "Extensions": "",
              "Paths": "",
              "Processes": ""
              }
      }
  SETTINGS
  
  tags {
      environment = "${var.tag_env}" }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9Plng.png" rel="nofollow noreferrer">Azure Portal Configuration for Antimalware Extension</a></p>
  
  <blockquote>
    <p>azurerm_virtual_machine_extension.test1: 1 error(s) occurred:`</p>
    
    <p>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."</p>
  </blockquote>
  
  <p>Does anyone know the proper syntax?</p>