Omer Anisfeld
Omer Anisfeld

Reputation: 1302

how to create VM from Azure CLi with exising key pair?

I tried to create VM from another VM via Azure CLI with this command :

 az vm create \
    --resource-group my_resource \
    --name newVMfromImage \
    --image firstMachine-image \
    --admin-username user_name \
    --data-disk-sizes-gb 150 20 --size Standard_B1ms \
      --verbose \
      ----ssh-key-value /path/to/publick/key/azure.pub

But I get this error :

az: error: unrecognized arguments: ----ssh-key-value /path/to/publick/key/azure.pub

Upvotes: 1

Views: 2446

Answers (2)

Vikas Goyal
Vikas Goyal

Reputation: 457

Correct, the 4 dashes (----) indicates a wrong transmission while uploading the .PUB file.

Remove the 2 additional dashes.

Upvotes: 0

Mike
Mike

Reputation: 366

----ssh-key-value /path/to/publick/key/azure.pub

should only be:

--ssh-key-value /path/to/publick/key/azure.pub

Remove the 2 additional dashes.

Upvotes: 1

Related Questions