I created an environment using a template that defines a Microsoft.Compute/virtualMachines resource and a Microsoft.Compute/virtualMachines/extensions resource to run CustomScript to do some post-deploy stuff.
But when I tried to apply an artifact on the created VM in the portal, it failed with the following error.
{"error":{"code":"BadRequest","message":"Multiple VMExtensions per handler not supported for OS type 'Linux'. VMExtension 'CustomScript' with handler 'Microsoft.Azure.Extensions.CustomScript' already added or specified in input."}}
The 'FMS_Linux' artifact failed to install. See artifact result for details.
Can anyone help why the error occurred? Does it mean VMs that have defined "CustomScript" can never use the artifact features? Thanks in advance.
The extension resource definition is like below.
{
"name": "[concat(parameters('virtualMachineName'),'/PostDeploy')]",
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2019-03-01",
"location": "[variables('location')]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', parameters('virtualMachineName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.1",
"autoUpgradeMinorVersion": true,
"settings": {
"skipDos2Unix": false,
"fileUris": [
"[variables('PostDeployScriptURL')]"
],
"timestamp": 123456789,
"commandToExecute": "[concat('sh ',variables('PostDeployScript'), ' \"',parameters('DNS'),'\"' )]"
}
}
}