Repository navigation
[Containerapp] az containerapp up: Validate registry server - #34262
Open
Vini Soto (vinisoto) wants to merge 2 commits into
Open
Vini Soto (vinisoto) wants to merge 2 commits into
Vini Soto (vinisoto) wants to merge 2 commits into
Conversation
…getting ACR credentials Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 424ccbab-d4be-43b7-a649-157ea7cf3da6
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Bin Du (northtyphoon) and
Terence Truong (terencet-dev)
October 22, 2026 18:30
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
az containerapp up: Validate registry server before getting ACR credentialsaz containerapp up: Validate registry server
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
URL-prefixed ACR servers produce an incorrect registry name, breaking previously handled credential lookups.
1 open issue
What changed in this PR
This PR adds registry validation before az containerapp up automatically retrieves Azure Container Registry credentials.
Changes:
- Validates registry names against the active cloud’s ACR suffix when either credential is missing.
- Adds mocked tests for valid and invalid servers, partial credentials, and existing source behavior.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_up_utils.py |
Adds focused registry validation and credential-lookup tests. |
src/azure-cli/azure/cli/command_modules/containerapp/_up_utils.py |
Validates and normalizes registry names before automatic credential lookup. |
Review effort: Balanced
Contributor
|
Hi Vini Soto (@vinisoto), |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 424ccbab-d4be-43b7-a649-157ea7cf3da6
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤖 PR Validation — ️✔️ All clear
Related command
az containerapp up --repoDescription
Validate the registry server before automatically retrieving ACR credentials when the registry username or password is missing.
The check uses the active cloud's ACR login-server suffix, normalizes the server name to lowercase, and rejects names containing additional dots before the suffix. Invalid servers raise
ValidationErrorwith guidance to provide a registry server or explicit credentials.The change is limited to the credentials-missing branch in
_get_registry_details. Existing handling of explicitly supplied credentials and the existing--sourceguard are unchanged.Testing Guide
Added mocked unit tests covering:
--source.Validation results:
azdev style containerapp— passed.azdev linter containerapp— passed.azdev test test_containerapp_up_utils test_containerapp_utils test_containerapp_validators --series --pytest-args --disable-socket— passed: 6 tests and 45 subtests.azdev test containerapp --series --pytest-args --disable-socket "--allow-hosts=localhost,$env:COMPUTERNAME"— stopped after 34 passed and 8 skipped;test_containerapp_compose_create_with_environmentfailed withKeyError: 'foo'in compose handling, outside the changed function.History Notes
[Containerapp]
az containerapp up: Validate registry server before getting ACR credentialsThis 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.