101-vm-sshkey fails this error
statusCode:BadRequest
statusMessage:{"error":{"code":"InvalidParameter","target":"linuxConfiguration.ssh.publicKeys.keyData","message":"The value of parameter linuxConfiguration.ssh.publicKeys.keyData is invalid."}}
Hello,
I've got the same error using this section in other template , be sure that your paste all the public key in the json value like this :
"sshKeyData": {
"value": "---- BEGIN SSH2 PUBLIC KEY ----
Comment: \"rsa-key-20151001\"
AAAAB....
.........
IVc1HWFrw==
---- END SSH2 PUBLIC KEY ----"
}
(I've escape the quote of the comment, but maybe the comment are not necessary, but I think ---BEGIN-- & ---END--- are required
Looks like you are using an SSH2 key. Is that required? I was just using an OpenSSH key which doesn't have the begin and end blocks
Don't know if it is a requirement , I've followed the tutorial available at https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-use-ssh-key/
I've used OpenSSL & puttygen to generate private & public key
@squillace might be able to help here
Hi @jdevillard it looks like you're actually using the .pem format described in that document, but in this case it's expecting the ssh-rsa format, which looks much different: It's the file created when you type ssh-keygen -t rsa -b 2048. (You should specify a passphrase as well to use it properly.)
ARM resources -- all take .pub files and it's not clear to me that they'll take .pem at all BUT....
...that topic is the topic I am currently rewriting at this very moment, validating all the instructions on mac, linux, and windows.
Finally, are you creating through the portal, or through the "azure group deployment create --template-uri method?
the keys should look something like the below, which is the location that gitbash's implementation of _ssh-keygen_ places them by default. Typically, people using Linux run from a Linux or Mac client computer, so we don't really expect that lots of people will be creating keys on Windows whether they use Putty or GitBash or Mobixterm or not. But if you read the docs for those items (before I finish rewriting that ssh topic) you should be able to create a key easily and pass the string in either the portal or using the azure cli (or powershell, for that matter).
cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnbJVCnaUoHap+jK+Wfvno6ahfu4npy5xixAt6uBYFkdpMprTxWHxh8ocdRhsCnx7dR05s5EVZV48kB9z2sCob+J4iEWi9nTvlQ8cqmrWGEOFisCHwgvPSFWY1
5sz+nOd8ry43xi7K5jrZ/NyIxz9+r4ZREHuMF1wPed5siik8jwL/ingY0kyTqfMDxe588/TnW2PkcUFHgJpBNqe78rBqmB/+7tk+R+UgFJ6RY//Xo+C5T/QfJNylrRdIam0wd0EFG8bg8Qou3S/32PIlW+/Hbgau
ksZcjFE7Ta/yUFa4f8Pt4YJszw0bhyVRCFUPJEz66f1q8L/3en/AMhBLknwh rasquill@MININT-GFPHKM1
@shirhatti sorry to leave you out, too. Same thing. :-|
Hmmm. Of course I went to go do it again, and... you're right. Something's wrong here. I'll find out!!!
!AH! You specify the sshkey on the command line without any quotations:
azure group deployment create \
--resource-group test-sshtemplate \
--template-uri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-sshkey/azuredeploy.json \
--name mysshdeployment
info: Executing command group deployment create
info: Supply values for the following parameters
testnewStorageAccountName: testsshvmtemplate3
adminUserName: ops
sshKeyData: ssh-rsa AAAAB3NzaC1yc2EAAAADAQA+/L+rHIjz+nXTzxApgnP+iKDZco9 rasquill@macbookpro
dnsNameForPublicIP: testsshvmtemplate
location: West Europe
vmName: sshvm
+ Initializing template configurations and parameters
+ Creating a deployment
info: Created template deployment "mysshdeployment"
+ Waiting for deployment to complete
data: DeploymentName : mysshdeployment
data: ResourceGroupName : test-sshtemplate
data: ProvisioningState : Succeeded
data: Timestamp : 2015-10-08T00:12:12.2529678Z
data: Mode : Incremental
data: TemplateLink : https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-sshkey/azuredeploy.json
data: ContentVersion : 1.0.0.0
data: Name Type Value
data: newStorageAccountName String testtestsshvmtemplate3
data: adminUserName String ops
data: sshKeyData String ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAkek3P6V3EhmD+xP+iKDZco9 rasquill@macbookpro
data: dnsNameForPublicIP String testsshvmtemplate
data: location String West Europe
data: vmSize String Standard_A2
data: vmName String sshvm
data: ubuntuOSVersion String 14.04.2-LTS
info: group deployment create command OK
Now I'll try it from the Portal...
Yep, it works perfect in the portal as well. OK, documentation update required. :-) Thanks for letting us know, and sorry we didn't pick up the comment as fast as we might have. Let us know you can have success as well.
Fix is https://github.com/Azure/azure-quickstart-templates/pull/695. In fact, however, the fix is to the ssh-key creation document, and that one is on the way.
Thanks @squillace! merged the readme update
Most helpful comment
the keys should look something like the below, which is the location that gitbash's implementation of _ssh-keygen_ places them by default. Typically, people using Linux run from a Linux or Mac client computer, so we don't really expect that lots of people will be creating keys on Windows whether they use Putty or GitBash or Mobixterm or not. But if you read the docs for those items (before I finish rewriting that ssh topic) you should be able to create a key easily and pass the string in either the portal or using the azure cli (or powershell, for that matter).