Skip to content

[ACR] az acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during creation#31661

Merged
zhoxing-ms merged 5 commits intoAzure:devfrom
joshbaunach:joshbaunach/connected-registry/fix-dedicated-endpoint-bug
Jun 20, 2025
Merged

[ACR] az acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during creation#31661
zhoxing-ms merged 5 commits intoAzure:devfrom
joshbaunach:joshbaunach/connected-registry/fix-dedicated-endpoint-bug

Conversation

@joshbaunach
Copy link
Contributor

@joshbaunach joshbaunach commented Jun 16, 2025

Related command
az acr connected-registry create

Description
In #28807, the behavior of az acr connected-registry create was modified. If the user does not have dedicated data endpoint enabled for their ACR, then the command would ask whether they want to enable it before creating the Connected Registry. However, there is a glitch. The ACR resource would only be modified in-memory, meaning that dedicated endpoint would remain disabled on the actual ACR.

This PR ensures an API request to modify the ACR is made when the user wants to enable dedicated endpoint on their ACR while creating a Connected Registry.

Testing Guide

  1. Create an ACR: az acr create -n [your name] -g [your rg] --sku premium
  2. Create a Connected Registry: az acr connected-registry create -n [your choice of connected registry name] --registry [your ACR name] --repository hello-world
  3. Wait for the CLI to prompt "Dedicated data endpoints must be enabled to use connected-registry. Enabling might impact your firewall rules. Are you sure you want to enable it for [ACR name] registry?". Reply with y.

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 16, 2025 19:50
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jun 16, 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

Hi @joshbaunach,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

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

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

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 16, 2025

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

@github-actions
Copy link

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
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 ensures that when creating a connected registry with a user-confirmed dedicated data endpoint, the Azure Container Registry is actually updated via API.

  • Added a test covering the case where the dedicated endpoint is not initially enabled.
  • Modified acr_connected_registry_create to call the ACR REST API (acr_update_set) after user confirmation.
  • Updated imports to bring in cf_acr_registries and acr_update_set for the new API call.

Reviewed Changes

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

File Description
test_acr_connectedregistry_commands.py Added test_acr_connectedregistry_dedicated_endpoint_not_enabled to verify endpoint enabling behavior
connected_registry.py Called cf_acr_registries and acr_update_set to persist the dataEndpointEnabled update
Comments suppressed due to low confidence (1)

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

  • Verify that acr_update_custom no longer requires resource_group_name as its parameter; if its signature still expects (cmd, registry, resource_group_name, ...), this call will fail at runtime.
acr_update_custom(cmd, registry, data_endpoint_enabled=True)

Copy link
Member

@trisavo-msft trisavo-msft left a comment

Choose a reason for hiding this comment

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

LGTM

@zhoxing-ms zhoxing-ms changed the title [ACR] Fix: enable dedicated endpoint on container registry resource when user confirms during az acr connected-registry create [ACR] az acr connected-registry create: Enable dedicated endpoint on container registry resource when user confirms during az acr connected-registry create Jun 19, 2025
@zhoxing-ms
Copy link
Contributor

image

Please note that 'history notes' here refers to the content that needs to be written into CLI release notes for this PR change, rather than any related historical PR content

@joshbaunach joshbaunach changed the title [ACR] az acr connected-registry create: Enable dedicated endpoint on container registry resource when user confirms during az acr connected-registry create [ACR] az acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during az acr connected-registry create Jun 19, 2025
@joshbaunach
Copy link
Contributor Author

@zhoxing-ms Thanks for the clarification on the History Notes section.

A bit of clarification regarding the title: this PR is a bugfix for the error where the command would fail if the user replied "y" to the dedicated endpoint prompt; the prompt itself was added in #28807. I updated the title to clarify that this PR is a bugfix, but feel free to update the title again if needed.

@zhoxing-ms zhoxing-ms changed the title [ACR] az acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during az acr connected-registry create [ACR] az acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during creation Jun 20, 2025
@zhoxing-ms
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@zhoxing-ms zhoxing-ms merged commit fd4a6cd into Azure:dev Jun 20, 2025
48 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 Container Registry az acr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants