Jeremy Thompson
Jeremy Thompson

Reputation: 65534

AZ Azure Commands fail: error: the following arguments are required: --name/-n, --resource-group/-g

Creating a resource in Azure with the following command:

az vm create --name quickvm --resource-group RG1 --image Debian --admin-username student --admin-password Password456#@long

Fails with:

az vm create: error: the following arguments are required: --name/-n, --resource-group/-g

This isn't the first time, the commands are definitely correct, so something funny is going on. Any ideas?

Upvotes: 1

Views: 9604

Answers (3)

Ami
Ami

Reputation: 11

I also had the same issue but, It was maybe due to the '' backslash: here the working line

az vm create   --resource-group learn-35bcc4c7-0aff-4bb9-93c0-79291229b46b   --name my-vm   --image UbuntuLTS   --admin-username azureuser --generate-ssh-keys

error line

az vm create \
  --resource-group learn-35bcc4c7-0aff-4bb9-93c0-79291229b46b \
  --name my-vm \
  --image UbuntuLTS \
  --admin-username azureuser \
  --generate-ssh-keys

Upvotes: 0

Dmitri
Dmitri

Reputation: 131

Same happened to me during Azure Fundamentals course:

az vm extension set \
       --resource-group learn-....\
       --vm-name my-vm \
       -n customScript \
       --publisher Microsoft.Azure.Extensions \
       --version 2.1 \
       --settings '{"fileUris":["https://raw.githubusercontent.com/Microsoft
       --protected-settings '{"commandToExecute": "./configure-nginx.sh"}'

the following arguments are required: --name/-n, --publisher

Switching from az interactive to bash helped.

Replacing dashes or spaces or copying-pasting into text editor didn't help.

Upvotes: 2

Jeremy Thompson
Jeremy Thompson

Reputation: 65534

Sometimes the formatting of the hyphens is malformed. Type the hyphens in again or replace the big-endians:

enter image description here

Upvotes: 3

Related Questions