feat(acr): add --endpoint-protocol parameter to az acr update#33089
feat(acr): add --endpoint-protocol parameter to az acr update#33089
Conversation
Add support for configuring the endpoint protocol (IPv4 and/or IPv6) on Azure Container Registries via az acr update. Changes: - Add --endpoint-protocol parameter with enum values IPv4, IPv4AndIPv6 - Set instance.endpoint_protocol in acr_update_custom() when provided - Add help text example for updating endpoint protocol - Add test_acr_with_dual_stack_endpoints scenario test Requires azure-mgmt-containerregistry >= 15.1.0b1 with API version 2026-01-01-preview which includes the EndpointProtocol property on the Registry model. Validated on dogfood registry srcregistryaue (Australia East): - az acr update --endpoint-protocol IPv4AndIPv6 → success - az acr update --endpoint-protocol IPv4 → success Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
❌AzureCLI-FullTest
|
|
Hi @avtakkar, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| acr update | cmd acr update added parameter endpoint_protocol |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
Adds support in the ACR command module for configuring an Azure Container Registry’s endpoint protocol (IPv4 vs dual-stack) via az acr update.
Changes:
- Introduces
--endpoint-protocol(IPv4 / IPv4AndIPv6) toaz acr update. - Wires the new argument through
acr_update_custom()to setinstance.endpoint_protocol. - Adds CLI help example and a new scenario test for dual-stack endpoints.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/acr/custom.py |
Sets endpoint_protocol on the update parameters when provided. |
src/azure-cli/azure/cli/command_modules/acr/_params.py |
Adds the --endpoint-protocol argument to acr update. |
src/azure-cli/azure/cli/command_modules/acr/_help.py |
Documents an example usage of --endpoint-protocol. |
src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_commands.py |
Adds a scenario test covering IPv4 ↔ dual-stack updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @ResourceGroupPreparer() | ||
| def test_acr_with_dual_stack_endpoints(self, resource_group, resource_group_location): | ||
| self.kwargs.update({ | ||
| 'registry_name': self.create_random_name('testreg', 20) | ||
| }) | ||
| self.cmd('acr create --name {registry_name} --resource-group {rg} --sku premium -l eastus', | ||
| checks=[self.check('endpointProtocol', 'IPv4')]) | ||
| self.cmd('acr update --name {registry_name} --resource-group {rg} --endpoint-protocol IPv4AndIPv6', | ||
| checks=[self.check('endpointProtocol', 'IPv4AndIPv6')]) | ||
| self.cmd('acr update --name {registry_name} --resource-group {rg} --endpoint-protocol IPv4', | ||
| checks=[self.check('endpointProtocol', 'IPv4')]) |
There was a problem hiding this comment.
This new scenario test will run in playback CI but there is no corresponding VCR recording file checked in (typically tests/latest/recordings/test_<test_name>.yaml). Either add the test_acr_with_dual_stack_endpoints.yaml recording or mark the test @live_only() to avoid failing in playback.
|
|
||
| with self.argument_context('acr update', arg_group='Network Rule') as c: | ||
| c.argument('data_endpoint_enabled', get_three_state_flag(), help="Enable dedicated data endpoint for client firewall configuration") | ||
| c.argument('endpoint_protocol', arg_type=get_enum_type(['IPv4', 'IPv4AndIPv6']), options_list=['--endpoint-protocol'], help="The endpoint protocol (IPv4 and/or IPv6) for the registry.") |
There was a problem hiding this comment.
--endpoint-protocol relies on a preview API version per the PR description; consider marking this argument as is_preview=True (and optionally clarifying preview status in the help text) to keep CLI surface aligned with other preview ACR arguments.
| c.argument('endpoint_protocol', arg_type=get_enum_type(['IPv4', 'IPv4AndIPv6']), options_list=['--endpoint-protocol'], help="The endpoint protocol (IPv4 and/or IPv6) for the registry.") | |
| c.argument('endpoint_protocol', arg_type=get_enum_type(['IPv4', 'IPv4AndIPv6']), options_list=['--endpoint-protocol'], is_preview=True, help="The endpoint protocol (IPv4 and/or IPv6) for the registry. This setting is currently in preview.") |
Add support for configuring the endpoint protocol (IPv4 and/or IPv6) on Azure Container Registries via az acr update.
Changes:
Requires azure-mgmt-containerregistry >= 15.1.0b1 with API version 2026-01-01-preview which includes the EndpointProtocol property on the Registry model.
Validated on dogfood registry srcregistryaue (Australia East):
Related command
Description
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 featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.