Getting Deployment Error while trying to deploy an Ubuntu Linux VM , SSH is the authentication type

Pallab Chakraborty 401 Reputation points
2021-01-11T23:00:25.667+00:00

I am getting the below error while trying to deploy an Ubuntu Linux VM . My VNET, Availability Set, Storage Account, Container, NIC, all got deployed successfully. But i am having issue while trying to deploy the VM. I have created an SSH Public Key in my local machine and the file name is "ssh.txt.pub". My private key file name is "ssh.txt"
I kept the parameter blank for "adminPasswordOrKey" securestring param, so that while deploying it will ask me to provide the public key. After providing the public key in the box during deployment, i get the below error :

{
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
"details": [
{
"code": "BadRequest",
"message": "Could not find member 'adminPasswordOrKey' on object of type 'OSProfile'. Path 'properties.osProfile.adminPasswordOrKey', line 1, position 333."
}
]
}

What is the way to pass on the public key generated from my local machine so that the VM gets deployed successfully?
My code is in the below repo

https://github.com/palchak/Ubuntu-VM.git

Any help would be appreciated

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,398 questions
0 comments No comments
{count} votes

Accepted answer
  1. TravisCragg-MSFT 5,691 Reputation points Microsoft Employee
    2021-01-12T00:52:12.303+00:00

    You can see detailed steps on how to deploy a VM using a SSH key Here. You will need to copy and paste the entire string (without any trailing spaces) into the blank, or provide the local file name.

    .
    You can also upload the keys to store in Azure and then use them with your VM.

    It looks like you are trying to use a template, so here is an example of deploying a VM using an SSH key with a template.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.