Is there a way to run 2 custom script extensions for a linux vm scaleset when deploying via ARM Template?
As of right now I can't as it give me the following error....
Showing 1 out of 1 error(s). Status Message: Multiple VMExtensions per handler not supported for OS type
| 'Linux'. VMExtension 'Microsoft.Azure.Extensions' with handler 'CustomScript' already added or specified in input.
The ARM code is example in the extensionProfile section
"extensionProfile": {
"extensions": [
{
"name": "script1",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "v1.0",
"settings": {
"fileUris": [
"[concat(parameters('scriptURL'), parameters('scriptName'))]"
]
},
"protectedSettings": {
"commandToExecute": "sh test.sh",
"storageAccountName": "[parameters('storageaccoutname')]",
"storageAccountKey": "[parameters('storageaccountkey')]"
}
}
},
{
"name": "script2",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "v1.1",
"settings": {
"fileUris": [
"[concat(parameters('scriptURL'), parameters('scriptName'))]"
]
},
"protectedSettings": {
"commandToExecute": "sh test2.sh",
"storageAccountName": "[parameters('storageaccoutname')]",
"storageAccountKey": "[parameters('storageaccountkey')]"
}
}
}
]
}
Referencing this page ...https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-linux
It says You can only have one version of an extension applied to the VM. In order to run a second custom script, you can update the existing extension with new configuration. Alternatively, you can remove the custom script extension and reapply it again with the updated script.
Which I don't really understand as that to me isn't possible to do while deploying via ARM template deployment that I am aware of... so I assume this means to update after the fact once it's deployed with just the 1 in the template.
If anyone can confirm that would be great
Thanks