azure-xplat-cli
azure-xplat-cli copied to clipboard
ARM: 'azure vm create' promps only for some required arguments
If I just run azure vm create
it only prompts for certain required fields, not all...
This makes all the prompt strings I typed earlier useless...
➜ ~ azure vm create
info: Executing command vm create
Resource group name: ahmetb-docker1.9
Virtual machine name: vm
Location name: westus
Operating system Type: linux
+ Looking up the VM "vm"
error: image-urn or os-disk-vhd parameter is required to create a VM
info: Error information has been recorded to /Users/alp/.azure/azure.err
error: vm create command failed
Need consistency here.
So if I specify --image-urn
, then it keeps prompting me for:
Enter username: azureuser
Enter password for azureuser: **********
Confirm password: **********
but shortly after I get:
info: Using the VM Size "Standard_A1"
info: The [OS, Data] Disk or image configuration requires storage account
+ Retrieving storage accounts
info: Could not find any storage accounts in the region "westus", trying to create new one
+ Creating storage account "clieb3c2f4ea488ddb614465" in "westus"
+ Looking up the storage account clieb3c2f4ea488ddb614465
error: Either NIC Id or NIC name is required
info: Error information has been recorded to /Users/alp/.azure/azure.err
error: vm docker create command failed
whoops. All gone again.
@amarzavery - we'll need to prompt for all the mandatory parameters from the very beginning. Can you please take a look?
@huangpf - Can you take a look at the command definition and find out the root cause for this issue?
Add @sauryadas to triage.
Still a valid issue. Also, nice to have...
👍 - seems that the storage account is created auto now, but NIC still is issue:

@jochenvw - Did you solve your NIC issue ? I'm facing the same issue. How did you pass NIC info to azure vm create command ? Thanks in advance.
@pdhandap Yup - that's what I did indeed. You can work around this issue - it's just not that convenient.
@jochenvw Would you be able to tell us how you did it exactly? I'm having the same issue as you did and @pdhandap, and would appreciate the help. What way do you pass the NIC info to the command?
+1 "What way do you pass the NIC info to the command?"
Long story short, documentation is not up to date and commands have different parameters across PowerShell/CLI/CLI in azure portal. To fix that NIC problem, you need to create a virtual network and network interface in the same resource group. Then you can pass the NIC name as an extra paramater to CLI command for example as below
azure vm create --name vmName --resource-group resourceGroupName --os-disk-vhd https://storage.blob.core.windows.net/vhds/some-disk.vhd --location "Australia East" --os-type Windows --nic-name someExistingNicName
You can use azure help vm create
for latest documentation of the command needed.