I am trying to create a (windows) VM from a deployment template file. in Starting it usually took 7 to 8 minutes to get the deployment done successfully and getting vm in 'Started' state. but with the passage of time its taking long (20-30) minutes or more to get the deployment done and getting the vm provisioned. here is the part of template that is being used to create a vm from custom vhd (vhd is syspreped):
"resources": [
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('vmName1')]",
"location": "[variables('location')]",
"properties": {
"hardwareProfile": {
"vmSize": "[variables('vmSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName1'))]"
}
]
},
"osProfile": {
"computerName": "[variables('vmName1')]",
"adminUsername": "[variables('adminUsername')]",
"adminPassword": "[variables('adminPassword')]"
},
"storageProfile": {
"osDisk": {
"ostype": "windows",
"name": "windows201606221843019334",
"vhd": {
"uri": "https://armstorageaccount.blob.core.windows.net/storage-31/vm2016062218430193341.vhd"
},
"image": {
"uri": "https://armstorageaccount.blob.core.windows.net/resource-vhd/VM-ARM-os-2016-06-08-37FFE535.vhd"
},
"caching": "readwrite",
"createOption": "FromImage"
}}}}]
before running the above template i am creating a public ip address resource using azure compute management libraries for .net and a network interface card resource using azure network management libraries for .net.Names of these resources are refered in the template above using proper variables. Since i am using async tasks so both of these resources are created before above template is run. i am deploying the template using azure resource management sdk for .net