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"
}