1

I'm trying to create 100 VM using azure-cli from custom image without public IP address. The VM will connect between them with load balancer.

The VM are creating using this command:

az vm create --resource-group myresourcegroup --availability-set my_as --name VMTestAS --image MyImage --public-ip-address none --admin-username azureuser --size Standard_F4S --no-wait --ssh-key-value my_key
1
  • arm template can achieve that easily, not sure about cli Commented Jul 11, 2017 at 15:50

2 Answers 2

4

For --public-ip-address "" there should be space between quotes otherwise it will fail as it expects a parameter.

Sign up to request clarification or add additional context in comments.

Comments

1

We can use CLI 2.0 to create Azure VM without public IP address, like this:

az vm create -n MyVm -g MyResourceGroup --public-ip-address ""

--public-ip-address
Name of the public IP address when creating one (default) or referencing an existing one. Can also reference an existing public IP by ID or specify "" for None.

More information about Azure CLI 2.0 to create Azure VM, please refer to this link.

Here is the result:

C:\Users\user>az vm create -n MyVm -g vm  --public-ip-address "" --image myimage
{
  "fqdns": "",
  "id": "/subscriptions/5384xxxx-xxxx-xxxx-xxxx-0361e29axxxx/resourceGroups/vm/providers/Microsoft.Compute/virtualMachines/MyVm",
  "location": "southcentralus",
  "macAddress": "00-0D-3A-73-F9-95",
  "powerState": "VM running",
  "privateIpAddress": "10.0.0.6",
  "publicIpAddress": "",
  "resourceGroup": "vm"
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.