Skip to content

Commit fd4a6cd

Browse files
authored
[ACR] az acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during creation (#31661)
1 parent 33be0f4 commit fd4a6cd

File tree

3 files changed

+1301
-4
lines changed

3 files changed

+1301
-4
lines changed

src/azure-cli/azure/cli/command_modules/acr/connected_registry.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from azure.cli.core.commands import LongRunningOperation
1212
from azure.cli.core.commands.client_factory import get_subscription_id
1313
from azure.cli.core.util import user_confirmation
14-
from ._client_factory import cf_acr_tokens, cf_acr_scope_maps
14+
from ._client_factory import cf_acr_tokens, cf_acr_scope_maps, cf_acr_registries
1515
from ._utils import (
1616
build_token_id,
1717
create_default_scope_map,
@@ -21,7 +21,7 @@
2121
parse_scope_map_actions,
2222
validate_managed_registry
2323
)
24-
from .custom import acr_update_custom
24+
from .custom import acr_update_custom, acr_update_set
2525

2626

2727
class ConnectedRegistryModes(Enum):
@@ -76,7 +76,9 @@ def acr_connected_registry_create(cmd, # pylint: disable=too-many-locals, too-m
7676
user_confirmation("Dedicated data endpoints must be enabled to use connected-registry. Enabling might " +
7777
"impact your firewall rules. Are you sure you want to enable it for '{}' registry?".format(
7878
registry_name), yes)
79-
acr_update_custom(cmd, registry, resource_group_name, data_endpoint_enabled=True)
79+
acr_update_custom(cmd, registry, data_endpoint_enabled=True)
80+
registry_client = cf_acr_registries(cmd.cli_ctx)
81+
acr_update_set(cmd, registry_client, registry_name, resource_group_name, registry)
8082

8183
from azure.core.exceptions import HttpResponseError as ErrorResponseException
8284
parent = None

0 commit comments

Comments
 (0)