fix(agents): validate discovered ACR connections#9225
Merged
trangevi merged 3 commits intoJul 21, 2026
Conversation
hund030
requested review from
JeffreyCA,
glharper,
huimiu,
therealjohn,
trangevi and
trrwilson
as code owners
July 21, 2026 06:44
|
Azure Pipelines: Successfully started running 1 pipeline(s). 21 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Validates discovered ACR connections during hosted agent initialization to avoid deferred publish failures.
Changes:
- Verifies ACR targets and persists valid resource IDs.
- Clears stale environment state during fallback.
- Adds regression tests for validation and fallback paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
init_foundry_resources_helpers.go |
Adds ACR discovery validation and fallback state handling. |
init_foundry_resources_helpers_test.go |
Tests valid, stale, mixed, fallback, and error scenarios. |
trangevi
approved these changes
Jul 21, 2026
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.
Summary
Fixes #9224. Hosted container agent initialization no longer accepts stale ACR connections from an existing Foundry project and defers the failure until publish.
Changes
agent init: validate discovered container registry targets against ARM, skip missing registries, and preserve authorization or service errors.Manual Validation
azd ai agent init -magainst an existing Foundry project whose sole ACR connection referenced a deleted registry.AZURE_CONTAINER_REGISTRY_ENDPOINT,AZURE_CONTAINER_REGISTRY_RESOURCE_ID, andAZURE_AI_PROJECT_ACR_CONNECTION_NAME, while settingAI_AGENT_PENDING_PROVISION=acr.azd deployresolved it and started an ACR build. The build later failed because that existing registry requires push credentials, after stale-connection handling had completed.