Azure / Azure/azure-cli

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

Open
#31,870 4 comments 0 reactions 1 assignee Claimed by @necusjz View on GitHub
act-quality-productivity-squad Auto-Assign Auto-Resolve Azure CLI Team customer-reported Network question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## 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 `
- 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:**
```json
{
"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

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.