Skip to content

[ACR] az acr import: Warn when a regional source endpoint falls back to the source registry's home region - #34032

Open
Zoey Li (lizMSFT) wants to merge 1 commit into
Azure:devfrom
lizMSFT:fix/acr-import-regional-endpoint-warning
Open

[ACR] az acr import: Warn when a regional source endpoint falls back to the source registry's home region#34032
Zoey Li (lizMSFT) wants to merge 1 commit into
Azure:devfrom
lizMSFT:fix/acr-import-regional-endpoint-warning

Conversation

@lizMSFT

@lizMSFT Zoey Li (lizMSFT) commented Sep 4, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

Related command
az acr import

Description
When an ACR regional endpoint is supplied as the import source, the CLI resolves it to the registry's ARM resource ID. Because the resource ID does not preserve the selected region, the import uses the source registry's home region.

This change:

  • emits a warning explaining that ACR imports do not support regional endpoint selection and will use the source registry's home region;
  • preserves the existing import behavior and compatibility with regional endpoint inputs;
  • handles regional endpoint hostnames case-insensitively;
  • removes the misleading help example that implied imports could select a source region.

Testing Guide
image

History Notes
[ACR] az acr import: Warn when a regional source endpoint falls back to the source registry's home region


This checklist is used to make sure that common guidelines for a pull request are followed.

Disclose that ACR imports use the source registry home region when a regional endpoint is supplied, and remove the misleading help example.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e546649a-5989-4d8f-8f65-a63ce8acba2e
@lizMSFT
Zoey Li (lizMSFT) requested a review from a team as a code owner September 4, 2026 05:00
Copilot AI lite review requested due to automatic review settings September 4, 2026 05:00
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The newly introduced warning text is emitted before source registry resolution and is phrased in a way that can be misleading in failure cases.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates az acr import to explicitly warn when a regional ACR endpoint is provided as the source, since imports ultimately resolve the registry by ARM resource ID and cannot preserve/select the requested regional replica.

Changes:

  • Add a warning when a regional endpoint (<registry>.<region>.geo<suffix>) is detected and converted to a standard login server.
  • Make regional endpoint suffix matching case-insensitive.
  • Remove a help example that implied regional endpoint selection for imports.
File summaries
File Description
src/azure-cli/azure/cli/command_modules/acr/import.py Adds the warning constant + emission during regional endpoint normalization; updates suffix matching to be case-insensitive.
src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_regional_endpoint_utils.py Extends unit tests to validate warning behavior and case-insensitive handling.
src/azure-cli/azure/cli/command_modules/acr/_help.py Removes the regional-endpoint import example from help text.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +28 to +29
REGIONAL_ENDPOINT_IMPORT_WARNING = "ACR imports do not support regional endpoint selection. " \
"This import will use the source registry's home region."
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants