When i am trying to deploy a template with extension i am getting timed out error as "Provisioning of VM extension InstallLamp has timed out. Extension provisioning has taken too long to complete. The extension did not report a message"
I am trying to install MySql through extension in a VM.
here is the extension code
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2018-06-01",
"name": "[concat(variables('vmName'),'/', 'InstallMySQL')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/',variables('vmName'))]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.7",
"autoUpgradeMinorVersion":true,
"settings": {
"fileUris": [
"<url of custom script>"
],
"commandToExecute": "sampleScript.sh"
}
}
Here is the sampleScript.sh code
sudo apt-get -y update
dbpass=12345678
export DEBIAN_FRONTEND=noninteractive
echo "mysql-server-5.7 mysql-server/root_password password" $dbpass | sudo debconf-set-selections >>
echo "mysql-server-5.7 mysql-server/root_password_again password" $dbpass | sudo debconf-set-selections
sudo apt-get -y install mysql-server-5.7
sudo apt-get -y install apache2 php7
sudo service apache2 restart