Skip to content

Cant get all the available ips in a subnet #21382

@RavivBenami

Description

@RavivBenami

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions