Skip to content

feat: add Foundry project add workflow - #9559

Open
Hui Miao (huimiu) wants to merge 16 commits into
mainfrom
hui/foundry-projects-core
Open

feat: add Foundry project add workflow#9559
Hui Miao (huimiu) wants to merge 16 commits into
mainfrom
hui/foundry-projects-core

Conversation

@huimiu

@huimiu Hui Miao (huimiu) commented Aug 13, 2026

Copy link
Copy Markdown
Member

Closes #9564

Why this is needed

azure.ai.projects already owns host: azure.ai.project, but adding a managed model deployment still required a separate project initialization step. That extra step blocks Foundry extensions from using resource-specific add commands, and azd core does not have an incremental add experience yet.

What this PR does

azd ai project add authors a new Foundry project service, adopts an existing project by ARM resource ID, or configures an endpoint-only existing project. azd ai project init stays public with the same flags, validation, and mutation path so current users and Agents callers keep working.

azd ai project deployment add creates the minimum azd workspace state and a missing azure.ai.project service before it writes a managed model deployment. Direct commands and delegated requests share that behavior. Workspace bootstrap still uses the existing empty-template flow. azd init --minimal is unchanged.

Delegated requests still accept azure.ai.agents/init. Project identity, Azure context, legacy project services, and project ID/location checks stay in place where resource reconciliation needs them. Updates stay idempotent and leave unrelated service fields alone. If a later deployment step fails, the authored project service is kept so the command can be retried.

Bicep and Terraform ejection still cover root and layered projects, including existing-project ownership checks and rollback on failed updates. Docs and tests cover command parity, self-initialization, and setup failures that must not write deployment configuration.

Why this approach

This is an extension-owned bridge until azd core has its own incremental add experience. Both public commands use one in-process authoring action. Deployment add calls that action directly with intermediate output disabled, instead of launching another Projects command. Validation, mutation, rollback, and output stay in one place, and the logic stays reusable if the extension later forwards to a core azd add command.

A Foundry project is valid without a model deployment, so a project service created before a later model-selection or deployment-reconciliation failure stays in the workspace.

This work covers the Projects side only. It does not add an Agents add command or accept delegated sources other than azure.ai.agents/init. project set, show, and unset still only manage runtime context and do not author azure.yaml. These commands update local project and environment configuration; Azure resources are created or updated later by azd provision or azd up. Design #9441 still uses project init as the primary spelling and should be updated.

Related to #9085. Based on the ownership design in #9441.

Validation

Projects extension tests and build pass. go fix, golangci-lint, and the Go spelling check pass. Fake-host tests cover direct and delegated deployment add when the project service is missing, and project setup failure before deployment mutation.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 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 the ext-projects azure.ai.projects extension label Aug 13, 2026
@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag Rick Winter (@RickWinter) and Kristen Womack (@kristenwomack) to let us know.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 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.

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.

Pull request overview

Adds Foundry project ownership and authoring to azure.ai.projects.

Changes:

  • Adds project initialization, adoption, and infrastructure ejection.
  • Adds managed model deployment authoring.
  • Adds delegated contracts, reconciliation, environment updates, and tests.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/exterrors/errors.go Adds compatibility errors.
internal/cmd/root.go Registers new commands.
internal/cmd/project_service_reconciler.go Reconciles project services.
internal/cmd/project_ownership_test.go Adds ownership-flow tests.
internal/cmd/project_init.go Implements project initialization and ejection.
internal/cmd/project_environment.go Manages project environment state.
internal/cmd/project_deployment.go Selects and reconciles deployments.
internal/cmd/project_deployment_add.go Implements deployment addition.
internal/cmd/delegated_contract.go Defines delegated request contracts.
go.mod Promotes RPC types to a direct dependency.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cli/azd/extensions/azure.ai.projects/internal/cmd/project_deployment_add.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/cmd/project_init.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/cmd/root.go
Comment thread cli/azd/extensions/azure.ai.projects/internal/cmd/project_init.go Outdated
Copilot AI review requested due to automatic review settings August 13, 2026 14:24
@github-actions github-actions Bot added area/extensions Extensions (general) ext-agents azure.ai.agents extension labels Aug 18, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm concerned about adding new commands before we have closure on the new proposed end to end path which John has been working on. Let's sync on that before moving forward with the new commands here

Comment thread cli/azd/extensions/azure.ai.projects/internal/cmd/project_init.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/cmd/project_deployment_add.go Outdated
@microsoft-github-policy-service microsoft-github-policy-service Bot added no-recent-activity identity issues with no activity and removed no-recent-activity identity issues with no activity labels Aug 25, 2026
@huimiu Hui Miao (huimiu) changed the title feat: add Foundry project ownership core feat: add Foundry project add workflow Sep 2, 2026
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.agents PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/9559/azure-ai-agents.zip"
  • Version: 1.0.0-beta.13.pr.9559.6776979
  • Merge commit: 0516406

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.projects PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/9559/azure-ai-projects.zip"
  • Version: 1.0.0-beta.8.pr.9559.6776980
  • Merge commit: 0516406

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 ext-projects azure.ai.projects extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden the Foundry project ownership flow

3 participants