将新 VM 添加到主机池时,我需要安装 sophos AV。我无法通过 AIB 编写 sophos 安装脚本,因为应用程序需要来自 Sophos Cloud Management Console 的动态数据来通用化映像,这是一项手动工作。
因此,我计划在通过“ARM 模板文件 URL”将 VM 添加到主机池时部署 Sophos:但是我不知道如何编写此 .json 文件的脚本以使其正常工作,我已经搜索了很多这是我得到的更接近:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"variables": {},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2018-06-01",
"name": "[concat(parameters('vmName'),'/CustomScriptExtension')]",
"location": "[resourceGroup().location]",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.10",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"https://demostoracc.file.core.windows.net/scripts/sophos_install.ps1"
],
"timestamp": 202101021
},
"protectedSettings": {
"commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -File sophos_install.ps1"
}
}
}
]
}
但仍然无法正常工作。