Skip to content

[Network] az network vnet subnet create/update: Support IPAM pool allocation#31643

Merged
necusjz merged 5 commits intoAzure:devfrom
cxznmhdcxz:subnet-ipam-pool-allocation
Jun 20, 2025
Merged

[Network] az network vnet subnet create/update: Support IPAM pool allocation#31643
necusjz merged 5 commits intoAzure:devfrom
cxznmhdcxz:subnet-ipam-pool-allocation

Conversation

@cxznmhdcxz
Copy link
Copy Markdown
Member

Related command

az network vnet subnet create/update

Description

resolve #31447
aaz Azure/aaz#781

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI review requested due to automatic review settings June 12, 2025 09:25
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jun 12, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jun 12, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️network
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd network vnet subnet create cmd network vnet subnet create added parameter ipam_pool_prefix_allocations
⚠️ 1006 - ParaAdd network vnet subnet update cmd network vnet subnet update added parameter ipam_pool_prefix_allocations

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jun 12, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for IPAM pool allocation in the subnet create/update workflow by adding a new property ("ipam_pool_prefix_allocations") and updating the API version from "2024-01-01" to "2024-07-01". It also adds test coverage for the new behavior and updates relevant AAZ schema definitions across multiple commands.

  • Updated API versions and AAZ schemas to "2024-07-01"
  • Added new "ipam_pool_prefix_allocations" field handling in command implementations and custom logic
  • Modified test cases to cover subnet creation with IPAM pool allocations

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

File Description
tests/latest/test_network_commands.py Renamed test function and added a new subnet create command to validate IPAM pool allocation
custom.py Added conditional checks for ipam_pool_prefix_allocations before clearing address_prefixes
aaz/latest/network/vnet/subnet/* Updated API versions and extended schema definitions to include IPv6 and IPAM pool allocations for subnet, update, show, list, delete, and create commands
Comments suppressed due to low confidence (1)

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/vnet/subnet/_create.py:70

  • [nitpick] Consider adding explicit validation to enforce mutual exclusivity between '--address-prefixes' and '--ipam-allocations' to prevent configuration conflicts.
help="Space-separated list of address prefixes in CIDR format. If provided, --ipam-allocations should not be specified.",

logger.warning(subnet_disable_pls_msg)
args.private_link_service_network_policies = args.disable_private_link_service_network_policies

if args.ipam_pool_prefix_allocations.to_serialized_data():
Copy link

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using the common 'has_value' function to check for ipam_pool_prefix_allocations instead of directly calling 'to_serialized_data()', to maintain consistency with the existing code.

Suggested change
if args.ipam_pool_prefix_allocations.to_serialized_data():
if has_value(args.ipam_pool_prefix_allocations):

Copilot uses AI. Check for mistakes.
necusjz
necusjz previously approved these changes Jun 17, 2025
yanzhudd
yanzhudd previously approved these changes Jun 17, 2025
Copy link
Copy Markdown
Member

@evelyn-ys evelyn-ys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all the test recordings are manually replacing with the new API version? All these tests can't pass live run? Even network module is using manual replacement which makes me uncertain about the quality...🤔

evelyn-ys
evelyn-ys previously approved these changes Jun 18, 2025
@cxznmhdcxz cxznmhdcxz force-pushed the subnet-ipam-pool-allocation branch from 7ede45b to a5ee38d Compare June 19, 2025 06:44
@necusjz necusjz merged commit 55f95f9 into Azure:dev Jun 20, 2025
48 checks passed
@cxznmhdcxz cxznmhdcxz deleted the subnet-ipam-pool-allocation branch August 13, 2025 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subnet create/update support for IPAM pool association

7 participants