Azure / Azure/azure-cli

[Network] `az network manager ipam-pool create/update`: Add `--min-allocation-size` and `--max-allocation-size`

Open
#34,044 1 comment 0 reactions 1 assignee Claimed by @necusjz View on GitHub
act-quality-productivity-squad Auto-Assign Azure CLI Team feature-request Network
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**
`az network manager ipam-pool create`
`az network manager ipam-pool update`
`az network manager ipam-pool show`
`az network manager ipam-pool list`

**Is your feature request related to a problem? Please describe.**
The Azure Network Manager IPAM RP is adding two new optional properties to the `IpamPool` resource (`Microsoft.Network/networkManagers/ipamPools`) in API version `2026-01-01`:

| Property | Type | Read/Write | Description |
|---|---|---|---|
| `minAllocationSize` | string | Read-write | Minimum number of IP addresses required for allocations from this IpamPool to be compliant. |
| `maxAllocationSize` | string | Read-write | Maximum number of IP addresses allowed for allocations from this IpamPool to be compliant. |

These let a pool administrator constrain the size of allocations taken from a pool, so that consumers cannot request blocks that are too small or too large for the pool's intended use.

The CLI does not yet expose these properties. Note that `az network manager ipam-pool` is served by the `network-manager` extension, which currently pins api-version `2024-05-01` — the extension will need to be regenerated against `2026-01-01` to pick these up.

**Value semantics (both properties)**

- The value is a **decimal count of IP addresses**, passed as a string (e.g. `"16"`, `"256"`).
- It is modeled as a string rather than an integer because the IPv6 upper bound is `2^121`, which exceeds the range of a 64-bit integer.
- Each value must be a **power of two**, within the pool's address family range:
- IPv4: `8` to `2^30`
- IPv6: `2` to `2^121`
- `minAllocationSize` must be less than or equal to `maxAllocationSize`.
- Neither value may exceed the pool's own total size.
- Both are optional. If not specified, no bound is enforced.
- On PATCH, omitting a bound leaves the current value unchanged; sending an empty string clears it.
- Invalid values are rejected by the service with `400 BadRequest`.

**Describe the solution you'd like**

- `az network manager ipam-pool create` should accept `--min-allocation-size` and `--max-allocation-size`.
- `az network manager ipam-pool update` should accept the same two parameters, and should support clearing a bound by passing an empty string (`--min-allocation-size ""`).
- `az network manager ipam-pool show` / `list` should display `minAllocationSize` and `maxAllocationSize` in the output when set.

Example:

```
az network manager ipam-pool create \
--name TestPool \
--network-manager-name TestNetworkManager \
--resource-group rg1 \
--address-prefixes 10.0.0.0/24 \
--min-allocation-size 16 \
--max-allocation-size 256

az network manager ipam-pool update \
--name TestPool \
--network-manager-name TestNetworkManager \
--resource-group rg1 \
--min-allocation-size 32 \
--max-allocation-size 512
```

**Describe alternatives you've considered**
Users can call the REST API directly via `az rest`, but native CLI support is preferred for discoverability and usability.

**Additional context**
- Resource Provider: `Microsoft.Network/networkManagers/ipamPools`
- Minimum API version required: `2026-01-01`
- PM Contact: @lijay (lijay@microsoft.com)
- Engineer Contact: @arjun-d-patel (arjunpatel@microsoft.com)
- Swagger PR: https://github.com/Azure/azure-rest-api-specs/pull/45650
- Extension: `network-manager` (`src/network-manager/azext_network_manager/aaz/latest/network/manager/ipam_pool/`), currently pinned to api-version `2024-05-01`
- Request examples:
- Create with bounds: https://github.com/arjun-d-patel/azure-rest-api-specs/blob/ad98419794b5edfccb2102ad7ed8143845819bf7/specification/network/resource-manager/Microsoft.Network/Network/stable/2026-01-01/examples/IpamPools_CreateWithAllocationBounds.json
- Update bounds: https://github.com/arjun-d-patel/azure-rest-api-specs/blob/ad98419794b5edfccb2102ad7ed8143845819bf7/specification/network/resource-manager/Microsoft.Network/Network/stable/2026-01-01/examples/IpamPools_UpdateAllocationBounds.json
- Clear bounds: https://github.com/arjun-d-patel/azure-rest-api-specs/blob/ad98419794b5edfccb2102ad7ed8143845819bf7/specification/network/resource-manager/Microsoft.Network/Network/stable/2026-01-01/examples/IpamPools_UpdateClearAllocationBounds.json

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.