[ACR] az acr connected-registry resync: Add command to manually trigger a sync from the parent registry#33236
[ACR] az acr connected-registry resync: Add command to manually trigger a sync from the parent registry#33236
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Hi @nihalvar, |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
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
Adds a new az acr connected-registry resync command to manually trigger a sync from the parent (cloud) registry to a connected (on-prem) registry, wiring it through the existing management-plane SDK operation and updating CLI UX and tests accordingly.
Changes:
- Register new
acr connected-registry resynccommand and implement handler callingConnectedRegistries.resync. - Add CLI help entry and extend connected-registry table output to surface sync status.
- Update connected-registry scenario test to invoke
resyncand assert failure in the no-agent test environment.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/acr/connected_registry.py | Adds acr_connected_registry_resync implementation calling the SDK resync operation. |
| src/azure-cli/azure/cli/command_modules/acr/commands.py | Registers the new acr connected-registry resync command in the command table. |
| src/azure-cli/azure/cli/command_modules/acr/_help.py | Adds help text and example usage for acr connected-registry resync. |
| src/azure-cli/azure/cli/command_modules/acr/_format.py | Adds “SYNC STATUS” fields to connected-registry show/list table formatting. |
| src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_connectedregistry_commands.py | Extends scenario test to execute resync and expect failure without an on-prem agent. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@nihalvar please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…acr_connectedregistry_commands.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Related command
az acr connected-registry resyncDescription
Adds a new command that issues a manual sync request to a connected (on-prem) registry from its parent cloud registry. Wraps the existing
ConnectedRegistries.resyncSDK operation (API version 2026-01-01-preview).The call is synchronous and returns the updated
ConnectedRegistryresource. The actual data transfer is performed asynchronously by the on-prem agent,lastSyncTimeupdates only after the agent reports completion. The next sync result will showsyncTrigger: ManualResync.Testing Guide
az acr connected-registry resync \ --name <myconnectedregistry> \ --registry <mycloudregistry> \ --resource-group <rg> # Subsequent show confirms the trigger: az acr connected-registry show \ --name <myconnectedregistry> \ --registry <mycloudregistry> \ --resource-group <rg> \ # -> "parent.syncProperties.registrySyncResult.syncTrigger" = "ManualResync"Recorded test (test_acr_connectedregistry) asserts expect_failure=True because the test registry has no on-prem agent attached, so the service returns ConnectedRegistryHasOfflineChildren. This still validates that the CLI command is correctly registered and accepts the right arguments.
History Notes
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.