last day (15 days later) » 

8:01 AM
0
A: Azure ARM Template - multiple Microsoft.Compute/virtualMachines/extensions for VM

Shengbao Shui - MSFTThe root reason is "[concat(parameters('virtualMachineName'),'/', 'SqlIaasExtension')]" is not exist. You should modify it like below: "[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'),'/extensions/SqlIaasExtension')]" You could check this link.

 
This question maybe helpful.
 
thanks. I tried and get new error. seems to a be separate issue now. It was the missing /extentions after VM name. The other example does not have it either. "message": "Deployment template validation failed: 'The template resource 'dbrestore' for type 'Microsoft.Compute/virtualMachines/extensions' at line '1' and column '7717' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name. Please see aka.ms/arm-template/#resources for usage details.'.",
something wrong with the type property? blogs.msdn.microsoft.com/kaevans/2015/11/22/…
 
Could you find the line you get the error log?
 
no. col 7717 is here. "SQLAuthUpdateUserName": "[parameters('sqlAuthenticationLogin')]" but i doubt this might be the error
 
Hi, you could check this link, you could not install two custom script extension at a template. You need use Microsoft.Resources/deployments to do this.
On your scenario, your script stores in a private blob. You need use a sas token to get it. See this link docs.microsoft.com/en-us/azure/azure-resource-manager/…
I test it on Azure Portal, it also like this imgur.com/a/prR0r
 
8:09 AM
ah. So if i buy a VM from marketplace with MSSQL installed on it, then there is no way to do auto restore on VM startup? Since marketplace VMs are already using custom script extensions to deploy products on VMs. which means Immutable deployments wont work with MSSQL on Azure VMs?? I had a look at the url. thanks for sharing. Are you saying if i use linked templates then i can use multiple cusom extensions on same VM? –
thanks for SAS url. i ll fix that
 
Yes, if you link, I think you could.
You use two script extensions in a template, it is not supported.
 
ah ok. then let me give a try and see via linked templates. thank you for the feedback.
 
will need to set dependency of linked templates too
thanks for your help.
 
9:09 AM
get the same error even after using linked deployments
i think it gives the error if u are doing 2 custom script executions on same VM
 
When do you get the error log, when you deploy it or after the script executed.
 
validation itself
before deployment
when i remove the 2nd custom script, no errors
 
Could you share your template two custom script.
the second custom extension.
 
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "dbrestore",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName') )]",
"[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'),'/extensions/SqlIaasExtension')]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.9",
"autoUpgradeMinorVersion": true,
 
Do you try this?
{
"name": "installmongo",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'),'/extensions/configuremongo')]"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('installMongoTemplateurl')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"vmName": {
"value": "[variables('vmName')]"
}
}
}
}
I think you could not create Custom Script extension in a template.
This link
 
9:19 AM
i dont get it. i have created a linked template and moved custom script extension there and the linked it.
if i cant write custom script extension in main script or other deployment then where?
/deployments is linked template.
 
'installMongoTemplateurl' The value is https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-d‌​ependency-between-scripts-using-extensions/install-mongo.json
 
yes i am doing same
but get this error
incorrect segment lengths. A nested resource type must have identical number of segments as its resource name
what does segement error means?
 
ok. i ll try out few things
i think this is azure limitation but wil try few things out
thanks for ur help though :)
 
If my answer helps, maybe you could accept it. Thanks.
 

last day (15 days later) »