[ACR] az acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during creation#31661
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @joshbaunach, |
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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
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_createto call the ACR REST API (acr_update_set) after user confirmation. - Updated imports to bring in
cf_acr_registriesandacr_update_setfor 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_customno longer requiresresource_group_nameas 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)
src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_connectedregistry_commands.py
Outdated
Show resolved
Hide resolved
az acr connected-registry create: Enable dedicated endpoint on container registry resource when user confirms during az acr connected-registry create
az acr connected-registry create: Enable dedicated endpoint on container registry resource when user confirms during az acr connected-registry createaz acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during az acr connected-registry create
|
@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. |
az acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during az acr connected-registry createaz acr connected-registry create: Fix for enabling dedicated endpoint on container registry resource when user confirms during creation
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |

Related command
az acr connected-registry create
Description
In #28807, the behavior of
az acr connected-registry createwas 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
az acr create -n [your name] -g [your rg] --sku premiumaz acr connected-registry create -n [your choice of connected registry name] --registry [your ACR name] --repository hello-worldy.This 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.