1 Answers
Hi Yasushi,
Are you still experiencing problems with this Azure CLI command?
I’ve just run some tests in the Cloud Playground, and been successfully able to use the command, in the following way.
Step 1: Create a VNET
az network vnet create --name vnet1 --resource-group XXXX --subnet-name web
Step 2: Create a VM
az vm create --name linux01 --resource-group XXXX --image rhel --vnet-name vnet1 --subnet web --public-ip-sku standard --admin-username master --generate-ssh-key
This should automatically generate SSH keys for you. However if you run into any issues accessing the VM after it is generated, you can always use Azure CLI to reset/update access. For example:
az vm user update --resource-group XXXX --name linux01--username azureuser --ssh-key-value ~/.ssh/id_rsa.pub
You should now be able to access the VM by typing:
ssh azureuser@PUBLICIPOFVM
Hope this helps!
James