Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acr/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,9 @@
- name: Turn on ABAC-based Repository Permission on an existing registry.
text: >
az acr update -n myregistry --role-assignment-mode rbac-abac
- name: Update the endpoint protocol for an Azure Container Registry.
text: >
az acr update -n myregistry --endpoint-protocol IPv4AndIPv6
"""

helps['acr webhook'] = """
Expand Down
1 change: 1 addition & 0 deletions src/azure-cli/azure/cli/command_modules/acr/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements

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.")
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

--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.

Suggested change
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.")

Copilot uses AI. Check for mistakes.

with self.argument_context('acr update') as c:
c.argument('anonymous_pull_enabled', get_three_state_flag(), help="Enable registry-wide pull from unauthenticated clients")
Expand Down
6 changes: 5 additions & 1 deletion src/azure-cli/azure/cli/command_modules/acr/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def acr_update_custom(cmd,
allow_exports=None,
tags=None,
allow_metadata_search=None,
role_assignment_mode=None):
role_assignment_mode=None,
endpoint_protocol=None):
if sku is not None:
Sku = cmd.get_models('Sku')
instance.sku = Sku(name=sku)
Expand Down Expand Up @@ -180,6 +181,9 @@ def acr_update_custom(cmd,
if role_assignment_mode is not None:
_configure_role_assignment_mode(cmd, instance, role_assignment_mode)

if endpoint_protocol is not None:
instance.endpoint_protocol = endpoint_protocol

_handle_network_bypass(cmd, instance, allow_trusted_services)
_handle_export_policy(cmd, instance, allow_exports)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,18 @@ def test_acr_with_anonymous_pull(self, resource_group, resource_group_location):
self.cmd('acr update --name {registry_name} --resource-group {rg} --anonymous-pull-enabled false',
checks=[self.check('anonymousPullEnabled', False)])

@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')])
Comment on lines +798 to +808
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

@ResourceGroupPreparer()
@live_only()
def test_acr_create_invalid_name(self, resource_group):
Expand Down
Loading