0
votes

I have created a VMSS (VM scaleset) with the Azure portal, and I want to add a custom script extension to it to install some software on it. How do I do this? I have tried using azure vmss config extensions set with a json file, but that doesn't seem to work. My json file looks like

{
"extensionProfile":{
    "extensions": [
        {
            "name": "bigstream spark",
            "properties": {
                "publisher": "Microsoft.Azure.Extensions",
                "type": "CustomScript",
                "typeHandlerVersion": "2.0",
                "autoUpgradeMinorVersion": true,
                "settings": {
                        "fileUris": [<some files....>
                        ],
                        "commandToExecute": "./installspark2.sh"
                },
                "protectedSettings": {
                    "storageAccountName": <accountname>,
                    "storageAccountKey": <secret>
                }
            }
        }]
    }
}
1

1 Answers

0
votes

Azure CLI 1.x does not have great extension support - the 'config' usage is confusing and I wouldn't recommend it. Fortunately the new CLI 2.0 based on Python does have a sensible add extension command for scale sets. When you create one I wouldn't put a space in the extension name though.

One more thing, take a look at this tool: https://github.com/gbowerman/vmsstools/tree/master/vmssextn - It helps out with basic extension CRUD (though shouldn't be needed so much after CLI 2.0).