Skip to content

feat(agents): eject Bicep for existing Foundry projects - #9348

Draft
hund030 wants to merge 3 commits into
Azure:mainfrom
hund030:fix/9127-brownfield-synthesis-pr
Draft

feat(agents): eject Bicep for existing Foundry projects#9348
hund030 wants to merge 3 commits into
Azure:mainfrom
hund030:fix/9127-brownfield-synthesis-pr

Conversation

@hund030

@hund030 hund030 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #9127. Existing Foundry projects can now eject Bicep with azd ai agent init --infra and use the same provisioning path as newly created projects without attempting to recreate the account or project.

Changes

  • azure.ai.agents: eject the complete static Bicep tree for endpoint-based projects, preserve environment references, and reject unsupported networking or literal credentials before writing infra/.
  • azure.ai.projects: reconcile model deployments, connections, and new or existing ACR resources against an existing project while retaining the no-work endpoint-only path.
  • synthesis/templates: replace the separate brownfield template with one conditional account/project resource graph and regenerate the embedded ARM template.

Design Details

  • foundryAccountName == '' selects greenfield creation; otherwise conditional existing account/project declarations target the configured brownfield resources.
  • A single fully qualified modelDeployments collection works with either account path. Greenfield-only project-name validation runs in a conditional module, so existing project names are preserved.
  • Provider-owned target and ACR parameters override on-disk values, secure ARM parameters are omitted from provisioning responses, and endpoint-derived canonical outputs cannot be replaced by stale or empty template outputs.
  • Brownfield deployments use a separate deployment name and derive subscription/resource-group context from AZURE_AI_PROJECT_ID; endpoint-only projects still skip ARM when no reconciliation is required.

Manual Validation

  • Ran azd ai agent init --infra --no-prompt against an existing Foundry project; it emitted the full static Bicep tree without modifying azure.yaml.
  • Ran azd provision --preview --no-prompt from the ejected project; Bicep compiled successfully and preview reported the existing Foundry account and project as skipped.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
20 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added area/extensions Extensions (general) ext-agents azure.ai.agents extension labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/extensions Extensions (general) ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Agents Extension] Unable to eject infra with existing foundry project

1 participant