feat: add Foundry project ownership core - #9559
Open
Hui Miao (huimiu) wants to merge 2 commits into
Open
Conversation
|
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. |
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
|
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. |
Contributor
There was a problem hiding this comment.
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 on lines
+150
to
+155
| if values["AZURE_AI_PROJECT_ID"] == "" { | ||
| return exterrors.Validation( | ||
| "project_deployment_requires_id", | ||
| "managed model deployments require an existing Foundry project resource ID", | ||
| "rerun `azd ai project init --project-id <resource-id>` after the project is provisioned", | ||
| ) |
Comment on lines
+656
to
+658
| func validateAllowedProjectLocation(project *resolvedProject, allowed []string) error { | ||
| if project == nil || len(allowed) == 0 || project.Location == "" { | ||
| return nil |
Comment on lines
+36
to
+37
| rootCmd.AddCommand(newProjectInitCommand(extCtx)) | ||
| rootCmd.AddCommand(newProjectDeploymentCommand(extCtx)) |
Comment on lines
+1109
to
+1112
| if _, err := client.Project().UnsetConfig(ctx, | ||
| &azdext.UnsetProjectConfigRequest{Path: "infra.path"}); err != nil { | ||
| _ = os.RemoveAll(infraDir) | ||
| return fmt.Errorf("remove infra.path: %w", err) |
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.
Closes #9564
Why this is needed
azure.ai.projectsalready owns provisioning forhost: azure.ai.project, but project authoring and reconciliation were still split across extensions. That made standalone project setup harder and left project identity, endpoints, managed deployments, and environment state with inconsistent ownership.What this PR does
This PR moves the core project authoring flow into
azure.ai.projects:azd ai project initto create a new project, adopt an existing project by ARM resource ID, or configure an existing project endpoint.azd ai project deployment addto select and record managed model deployments in the project service.Why this approach
The extension that owns
host: azure.ai.projectshould also own its service configuration. Keeping project initialization and deployment authoring as separate commands lets a project exist without a model deployment, while the delegated contract lets higher-level flows orchestrate both operations when needed.Scope
This PR implements the projects-side ownership core. The Agents handoff, recording proxy, and infrastructure layering work remain separate follow-ups.
Validation
go test ./...fromcli/azd/extensions/azure.ai.projectsRelated to #9085 and based on the ownership design in #9441.