Azure / Azure/azure-cli

Cant get all the available ips in a subnet

Open
#21,382 1 comment 0 reactions 1 assignee Claimed by @kairu-ms View on GitHub
act-quality-productivity-squad Auto-Assign customer-reported feature-request Network
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.