Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

Cant get all the available ips in a subnet #21382

Open RavivBenami opened 2 years ago

RavivBenami commented 2 years ago

Describe the bug

I want to get all the available ips in all the subnets in a vnet.

What I've did is to get all the subnets ids by
$subnetIds = az network vnet subnet list -g test --vnet-name test --query [].{id:id} -o tsv and save them into a var called subnetIds. Then I used az network vnet list-available-ips --ids $subnetIds and the print was

[ { ip1, ip2, ip3 } { ip1, ip2, ip3 } { ip1, ip2, ip3 } ]

the same object over and over again, but I have 3 different subnets with different numbers of available ips (3,4,1) .

To Reproduce

Just use az network vnet list-available-ips --ids id1 id2

with two different subnets ids

Expected behavior

Showing me the available ips for each subnet I put on --ids

Environment summary

powershell az cli version - 2.25.0

yonzhan commented 2 years ago

network