Skip to content

{Network} Fix inconsistent ipv6 parameter behavior in az network nat gateway#33186

Merged
necusjz merged 1 commit intoAzure:devfrom
huiii99:fix-inconsistent-ipv6-param-behavior
Apr 20, 2026
Merged

{Network} Fix inconsistent ipv6 parameter behavior in az network nat gateway#33186
necusjz merged 1 commit intoAzure:devfrom
huiii99:fix-inconsistent-ipv6-param-behavior

Conversation

@huiii99
Copy link
Copy Markdown
Member

@huiii99 huiii99 commented Apr 15, 2026

Related command
az network nat gateway create/update

Description
Fixes #33167
aaz Azure/aaz#984

The existing --pip-addresses-v6 and --pip-prefixes-v6 parameters on az network nat gateway create/update require complex JSON input ([{"id":"/subscriptions/.../publicIPAddresses/..."}]), while the IPv4 counterparts (--public-ip-addresses, --public-ip-prefixes) accept simple resource names or IDs. This inconsistency is confusing for users.

This PR introduces user-friendly --pip-addresses-v6 and --pip-prefixes-v6 parameters that accept either a name or an ID (space-separated), matching the behavior of existing IPv4 parameters while preserving the traditional JSON format.

Testing Guide

  • az network nat gateway create with --pip-addresses-v6
  • az network nat gateway update with --pip-addresses-v6

History Notes


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 April 15, 2026 02:08
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Apr 15, 2026

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

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

azure-client-tools-bot-prd bot commented Apr 15, 2026

⚠️AzureCLI-BreakingChangeTest
⚠️network
rule cmd_name rule_message suggest_message
⚠️ 1010 - ParaPropUpdate network nat gateway create cmd network nat gateway create update parameter pip_addresses_v6: updated property name from pip_addresses_v6 to pip_addresses_v6_input
⚠️ 1010 - ParaPropUpdate network nat gateway create cmd network nat gateway create update parameter pip_addresses_v6: updated property type from List<Object> to List<String>
⚠️ 1010 - ParaPropUpdate network nat gateway create cmd network nat gateway create update parameter pip_prefixes_v6: updated property name from pip_prefixes_v6 to pip_prefixes_v6_input
⚠️ 1010 - ParaPropUpdate network nat gateway create cmd network nat gateway create update parameter pip_prefixes_v6: updated property type from List<Object> to List<String>
⚠️ 1010 - ParaPropUpdate network nat gateway update cmd network nat gateway update update parameter pip_addresses_v6: updated property name from pip_addresses_v6 to pip_addresses_v6_input
⚠️ 1010 - ParaPropUpdate network nat gateway update cmd network nat gateway update update parameter pip_addresses_v6: updated property type from List<Object> to List<String>
⚠️ 1010 - ParaPropUpdate network nat gateway update cmd network nat gateway update update parameter pip_prefixes_v6: updated property name from pip_prefixes_v6 to pip_prefixes_v6_input
⚠️ 1010 - ParaPropUpdate network nat gateway update cmd network nat gateway update update parameter pip_prefixes_v6: updated property type from List<Object> to List<String>

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 3 pipeline(s).

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

Note

Copilot was unable to run its full agentic suite in this review.

Updates az network nat gateway to accept IPv6 public IP address/prefix inputs in the same user-friendly “names or IDs” form as the existing IPv4 parameters, addressing inconsistent CLI behavior.

Changes:

  • Add new --public-ip-addresses-v6 / --public-ip-prefixes-v6 arguments and map them into the NAT Gateway model fields.
  • Introduce/extend tests covering StandardV2 NAT Gateway creation using IPv6 public IPs/prefixes.
  • Simplify existing NAT Gateway test setup by removing --ip-tags usage in public IP/prefix creation.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.

File Description
src/azure-cli/azure/cli/command_modules/network/tests/latest/test_natgateway_commands.py Adds coverage for creating a StandardV2 NAT Gateway with IPv6 addresses/prefixes using the new CLI parameters.
src/azure-cli/azure/cli/command_modules/network/operations/nat.py Adds new AAZ args for IPv6 PIP addresses/prefixes and wires them into pre-operations for create/update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/azure-cli/azure/cli/command_modules/network/operations/nat.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/network/operations/nat.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/network/operations/nat.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/network/operations/nat.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/network/operations/nat.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/network/operations/nat.py Outdated
@huiii99 huiii99 changed the title {Network} Fix inconsistent IPv6 parameter behavior in az network nat gateway {Network} Add --public-ip-addresses-v6 and --public-ip-prefixes-v6 to az network nat gateway Apr 15, 2026
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 3 pipeline(s).

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 15, 2026

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>

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Apr 15, 2026

instead of introducing new parameters, we'd better modify existing parameters: --pip-addresses-v6 and --pip-prefixes-v6, to make them has the same behaviour.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 3 pipeline(s).

@huiii99 huiii99 force-pushed the fix-inconsistent-ipv6-param-behavior branch from 1948ffb to fb455c1 Compare April 16, 2026 01:24
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 3 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 3 pipeline(s).

@huiii99 huiii99 force-pushed the fix-inconsistent-ipv6-param-behavior branch from 8b764cf to 2c076ff Compare April 16, 2026 03:06
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 3 pipeline(s).

@huiii99 huiii99 changed the title {Network} Add --public-ip-addresses-v6 and --public-ip-prefixes-v6 to az network nat gateway {Network} Fix inconsistent v6 parameter behavior in az network nat gateway Apr 16, 2026
@huiii99 huiii99 changed the title {Network} Fix inconsistent v6 parameter behavior in az network nat gateway {Network} Fix inconsistent ipv6 parameter behavior in az network nat gateway Apr 16, 2026
Comment thread src/azure-cli/azure/cli/command_modules/network/operations/nat.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/network/operations/nat.py Outdated
@huiii99 huiii99 force-pushed the fix-inconsistent-ipv6-param-behavior branch from 2c076ff to 867e368 Compare April 17, 2026 00:54
fix: apply review suggestion

fix: retain legacy JSON format and introduce the same behavior as IPv4

dev

dev

dev

dev

fix: line too long style error

dev
@huiii99 huiii99 force-pushed the fix-inconsistent-ipv6-param-behavior branch from c97926a to 5f51e42 Compare April 17, 2026 06:38
@necusjz necusjz merged commit 632464b into Azure:dev Apr 20, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

az network nat gateway create with pip-prefixes-v6 fails on single id

4 participants