Required parameter ‘adminPassword’ is missing (null).


In case you have not read the article which led to this one, check it out here “How to use ARM templates for deployments”.  Once I resolved the previous 2 bumps:

The final action was to provide an admin password for my VMs. 

image

Figure1 – failed deployment using an Azure ARM template

When I clicked on the ‘Operations details’ I saw the following output as the cause of the failure.

{
 "error": {
 "code": "InvalidParameter",
 "target": "adminPassword",
 "message": "Required parameter 'adminPassword' is missing (null)."
 }
}

I am not a security expert, but I can see why those who make the security decisions would not include the password to an already created VM via a link within the portal.  Therefore, searching through the template I found the following and thought a good place for the adminPassword would be right after the adminUsername and therefore, replaced the following:

"osProfile": { 
 "computerName": "[parameters('virtualMachines_HCM001_name')]", 
 "adminUsername": "HCMAdmin", 
 "windowsConfiguration": 
 { 
   "provisionVMAgent": true, 
   "enableAutomaticUpdates": true 
 },    
  ...

with this:

"osProfile": {
  "computerName": "[parameters('virtualMachines_HCM001_name')]", 
  "adminUsername": "HCMAdmin",  
  "adminPassword": "P@ssw0rd",
  "windowsConfiguration": { 
    "provisionVMAgent": true, 
    "enableAutomaticUpdates": true },
  ...

And that completed the journey.

Although a little challenging, this is possible and actually quite fulflling to solve the issues and be successful.

To get a overview of the project I worked on, read the following articles as well.

Comments (0)

Skip to main content