Skip to content

az network vnet list-available-ips: Add total count metadata for capacity planning #31870

@UnXpectedSparkWorker

Description

@UnXpectedSparkWorker

Describe the bug

Command Name
az network vnet list-available-ips

Issue:
The command only returns a limited list of available IPs (appears to be first 5 available) without providing the total count of available IPs or indicating that the response is truncated.

Related Issues

This builds on previously closed issues (#25427, #13853) which focused on listing more IPs. However, this request is specifically for metadata (total count) rather than an exhaustive list, which serves different operational use cases.

To Reproduce:

  • Create a VNet with a /24 subnet (should have ~248 available IPs after Azure reservations for platform usage)
  • Run az network vnet list-available-ips --ids <vnet-resource-id>
  • Observe that only 5 IPs are returned despite many more being available

Expected Behavior

The API response should include:

  1. Total count of available IPs - essential for capacity planning and monitoring
  2. Clear indication if the list is truncated - so users know there are more IPs available
  3. Optional pagination or limit parameters - to control response size

Suggested response format:

{
  "totalAvailableIPs": 247,
  "availableIPs": ["10.0.0.4", "10.0.0.5", "..."],
  "truncated": true
}

Environment Summary

Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39, Ubuntu 24.04.2 LTS
Python 3.12.8
Installer: DEB

azure-cli 2.71.0 *

Additional Context

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAuto-ResolveAuto resolve by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamNetworkaz network vnet/lb/nic/dns/etc...act-quality-productivity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions