具有Azure ARM的VM的多个扩展 [英] Multiple extensions for a VM with Azure ARM

查看:65
本文介绍了具有Azure ARM的VM的多个扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用ARM配置虚拟机. 我们使用DSC来安装大多数要求,但是,将反恶意软件扩展程序与DSC一起安装是行不通的.

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.

我们收到以下错误: 操作系统类型"Windows"不支持每个处理程序多个VMExtensions.在输入中已添加或指定了带有处理程序"Microsoft.Powershell.DSC"的VMExtension'dscExtension'.

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.

资源如下:

 {  
  "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')]"
            }
         }
      }

推荐答案

查找模板时,将同时执行2个扩展.向其中之一添加一个DependOn:

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')]"
  ],

这篇关于具有Azure ARM的VM的多个扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆