Skip to content

Get List of Available IP for Subnet #13853

@geoarchitect

Description

@geoarchitect

Azure CLI recently added this command:

az network vnet list-available-ips -g [resource group] -n [vnet name]

This works great but only seems to return some ip addresses in the VNet.

Can we leverage the jmeshquery --query to specify some ip range or a subnet to narrow this down?

Is your feature request related to a problem? Please describe.
Yes, the list-available-ips command doesnt return all available ip's

For example you may have 192.168.0.0/16 and you may have a bunch of subnets, can we filter to a given subnet, or get all available ip's from the vnet.

Describe the solution you'd like
Option 1 - Possibly use --query to specify the ip range of the subnet or subnet name

Option 2 - Add the same list-available-ips command for az network vnet subnet

If there is a way to do this, maybe we can document it and update the CLI Docs with an example.

Describe alternatives you've considered
Manually typing random ip's in a range to see if they are consumed.

Additional context
We did this for VNet level but that only returns some of the available ip's.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions