我们正在使用ARM配置我们的VM。 我们使用DSC来安装大多数要求,但是,将反恶意软件扩展程序与DSC一起安装不起作用。
我们收到以下错误: 操作系统类型“Windows”不支持每个处理程序多个VMExtensions。已在输入中添加或指定了处理程序“Microsoft.Powershell.DSC”的VMExtension“dscExtension”。
资源看起来像这样:
{
"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')]"
}
}
}
答案 0 :(得分:0)
查看模板时,会同时执行2个扩展。将dependsOn添加到其中一个:
<input type="file" />