首页 > 解决方案 > azure arm 模板在部署期间安装 2 个自定义应用程序......但只有 1 个应用程序正在安装

问题描述

我试图在部署期间通过相同的 arm 模板安装 2 个自定义应用程序。arm 模板将进行域加入。然后在重新启动后去安装应用程序。

记事本++ 和 Sophos。

我遇到的问题是只有 1 个应用程序会安装,它不会继续安装到下一个应用程序。我想也许不需要在记事本++部分重新启动。

我阅读了以下帖子通过同一 VM 上的 Azure 模板运行多个自定义脚本 ,它提到需要一个 dependsOn,但我不明白 sophos 将如何依赖 notepad++ 安装,所以我不完全确定发生了什么..

据我所知,template.json 代码是正确的。

任何人都可以看到任何不正确的东西吗?

{
            "type": "Microsoft.Compute/virtualMachines/extensions",
            "apiVersion": "2016-04-30-preview",
            "name": "[concat(parameters('virtualMachineName'),'/joindomain')]",
            "location": "[resourceGroup().location]",
            "dependsOn": [
                "[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
            ],
            "tags": "[parameters('tags')]",
            "properties": {
                "publisher": "Microsoft.Compute",
                "type": "JsonADDomainExtension",
                "typeHandlerVersion": "1.3",
                "autoUpgradeMinorVersion": true,
                "settings": {
                    "Name": "[parameters('domainToJoin')]",
                    "OUPath": "[parameters('DomainOuPath')]",
                    "User": "[concat(parameters('domainToJoin'), '\\', parameters('domainJoinUserName'))]",
                    "Restart": "true",
                    "Options": "[parameters('domainJoinOptions')]"
                    
                },
                "protectedSettings": {
                    "Password": "[parameters('domainJoinUserPassword')]"
                }
            }
        },
        {
            "type": "Microsoft.Compute/virtualMachines/extensions",
            "name": "[concat(parameters('virtualMachineName'), '/Notepadplusplus')]",
            "apiVersion": "2015-05-01-preview",
            "location": "[parameters('location')]",
            "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/',parameters('virtualMachineName'))]" ],
            "tags": "[parameters('tags')]",
            "properties": { "publisher": "Microsoft.Compute",
            "type": "CustomScriptExtension", "typeHandlerVersion": "1.3", "autoUpgradeMinorVersion": true,
            "settings": { 
                "fileUris": [ "https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.1.9/npp.8.1.9.Installer.x64.exe"],
                "Restart": "true"
            },
            "protectedSettings": {
                "commandToExecute": "npp.8.1.9.Installer.x64.exe /S"   
            }
        }
    },
        {
            "type": "Microsoft.Compute/virtualMachines/extensions",
            "name": "[concat(parameters('virtualMachineName'), '/SophosInstall')]",
            "apiVersion": "2015-05-01-preview",
            "location": "[parameters('location')]",
            "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/',parameters('virtualMachineName'))]" ],
            "tags": "[parameters('tags')]",
            "properties": { "publisher": "Microsoft.Compute",
            "type": "CustomScriptExtension", "typeHandlerVersion": "1.3", "autoUpgradeMinorVersion": true,
            "settings": { 
                "fileUris": [ "https://dzr-api-amzn-eu-west-1-9af7.api-upe.p.hmr.sophos.com/api/download/cfd5ef35d72a66d96e761ba9222464d8/SophosSetup.exe" 
                ]
            },
            "protectedSettings": {
                "commandToExecute": "SophosSetup.exe --quiet --devicegroup=\"Test servers\""   
            }
        }
    }

标签: arm-templateazure-template

解决方案


推荐阅读