Search code examples
mongodbazureazure-storageredhatazure-resource-manager

Multiple VMExtensions per handler not supported for OS type 'Linux


I have created Azure VM using ARM template. Now I want to install Java and Mongodb on Azure VM.

When I try to use Multiple CustomScript, I get the following error.

Multiple VMExtensions per handler not supported for OS type 'Linux

Below are my configuration:-

parameters:-

"javaPackageName": {
    "type": "string",
    "defaultValue": "openjdk-7-jdk",
    "allowedValues": [
        "openjdk-6-jdk",
        "openjdk-7-jdk",
        "openjdk-8-jdk"
    ]
},
"tomcatPackageName": {
    "type": "string",
    "defaultValue": "tomcat7",
    "allowedValues": [
    "tomcat6",
    "tomcat7",
    "tomcat8"
    ]
}

variables:-

"mongoInstallCentos": "https:/..install-mongo.json"

{
    "type": "Microsoft.Compute/virtualMachines/extensions",
    "name": "[concat(parameters('virtualMachineName'),'/javainstall')]",
    "apiVersion": "2015-05-01-preview",
    "location": "[variables('location')]",
    "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
    ],
    "properties": {
        "publisher": "Microsoft.Azure.Extensions",
        "type": "CustomScript",
        "typeHandlerVersion": "2.0",
        "autoUpgradeMinorVersion": true,
        "settings": {
        "fileUris": ["https://..java-tomcat-install.sh"],
        "commandToExecute": "[concat('sh java-tomcat-install.sh',' ',parameters('javaPackageName'),' ',parameters('tomcatPackageName'))]"
        }
    }
},
{
    "type": "Microsoft.Compute/virtualMachines/extensions",
    "name": "[concat(parameters('virtualMachineName'),'/mongoinstall')]",
    "apiVersion": "2015-05-01-preview",
    "location": "[variables('location')]",
    "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
    ],
    "properties": {
        "publisher": "Microsoft.Azure.Extensions",
        "type": "CustomScript",
        "typeHandlerVersion": "2.0",
        "autoUpgradeMinorVersion": true,
        "settings": {
        "fileUris": ["https://..mongo-install.sh"],
        "commandToExecute": "sh mongo-install.sh"
        }
    }
},

Is there any solution use Multiple CustomScript in ARM template? Kindly help me to solve this.


Solution

  • Multiple VMExtensions per handler not supported for OS type 'Linux

    Currently , it is not possible to run Multiple CustomScript Extensions at the deployment time.

    According to your scenario, you can author an entry point script that calls the dependent scripts, then upload the entry point script, dependent scripts and any other dependent binaries to the script location(Azure storage blob or GitHub). More information please refer to this link.

    Also, you could refer to this similar question.