As part of my ARM Template, I need to execute PowerShell script to install Failover cluster windows feature. However, the script run for at least 10 min then fails with following error.
new-azResourceGroupDeployment : 11:18:03 - Resource Microsoft.Compute/virtualMachines/extensions 'DI-ukwest-DB1/extensions' failed with message '{ "status": "Failed", "error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "VMExtensionProvisioningError", "message": "VM has reported a failure when processing extension 'extensions'. Error message: \"Failed to download all specified files. Exiting. Error Message: The remote server returned an error: (400) Bad Request.\"." } ] } }'
My script is
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('varnodeNamePrefix'),copyindex(1),'/extensions')]",
"apiVersion": "2017-03-30",
"location": "[variables('varlocation')]",
"dependsOn": [
"[concat(variables('varnodeNamePrefix'),copyindex(1))]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.8",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"https://XXXXXarmtemplets.file.core.windows.net/powershellscripts/sqlcluster/InstallWindowsFeaturs.ps1"
]
},
"protectedSettings": {
"commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -InstallWindowsFeaturs.ps1",
"storageAccountName": "XXXXXarmtemplets",
"storageAccountKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
},
"copy": {
"name": "WinFeatures",
"count":"[variables('varvmCount')]"
}
}
Thanks
-File \"./powershellscripts/sqlcluster/InstallWindowsFeaturs.ps1\"instead of what you are doing - 4c74356b41