Skip to content

feat: transfer Foundry provisioning to projects#9133

Open
huimiu wants to merge 7 commits into
mainfrom
hui/own-ai-project-service
Open

feat: transfer Foundry provisioning to projects#9133
huimiu wants to merge 7 commits into
mainfrom
hui/own-ai-project-service

Conversation

@huimiu

@huimiu huimiu commented Jul 14, 2026

Copy link
Copy Markdown
Member

Fixes: #9134

Summary

  • Transfer the microsoft.foundry provider and validation check from azure.ai.agents to azure.ai.projects.
  • Move split-project deployment projection to projects lifecycle handlers while retaining the agents pre-split fallback.
  • Mirror synthesis temporarily with parity checks until Stage 2 moves init ownership.
  • Prepare coordinated releases: azure.ai.projects 1.0.0-beta.3 and azure.ai.agents 1.0.0-beta.6.

Validation

  • go test ./... -count=1 and go build ./... in both extension modules.
  • golangci-lint run ./... in both extension modules.
  • Projects CI build metadata injection and spelling checks.

Release coordination

Publish both extension artifacts before atomically updating their registry entries and the microsoft.foundry meta-package. Mixed old/new extension versions cannot register the provider together.

@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 ext-agents azure.ai.agents extension ext-projects azure.ai.projects extension labels Jul 14, 2026
@huimiu huimiu marked this pull request as ready for review July 14, 2026 10:24
Copilot AI review requested due to automatic review settings July 14, 2026 10:24
@huimiu huimiu linked an issue Jul 14, 2026 that may be closed by this pull request
@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

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 @RickWinter and @kristenwomack to let us know.

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

Transfers Foundry provisioning ownership from azure.ai.agents to azure.ai.projects, including lifecycle projection, validation, infrastructure synthesis, and coordinated versioning.

Changes:

  • Registers the Foundry provider and validation checks in Projects.
  • Moves deployment projection while retaining legacy Agents fallback.
  • Adds synchronized release metadata, tests, templates, and documentation.

Reviewed changes

Copilot reviewed 66 out of 67 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
docs/reference/telemetry-data.md Updates telemetry ownership.
cli/azd/extensions/azure.ai.projects/version.txt Bumps Projects version.
cli/azd/extensions/azure.ai.projects/README.md Documents project ownership.
cli/azd/extensions/azure.ai.projects/internal/version/version.go Adds build metadata.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/terraform/variables.tf Defines Terraform inputs.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/terraform/provider.tf Configures Terraform providers.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/terraform/outputs.tf.tmpl Defines conditional outputs.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/terraform/main.tf Provisions core Foundry resources.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/terraform/acr.tf Provisions connected ACR.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/modules/subnet.bicep Adds subnet module.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/modules/resources.bicep Defines Foundry resources.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/modules/private-endpoint-dns.bicep Adds private endpoint and DNS.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/modules/network.bicep Adds VNet wiring.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/modules/connections.bicep Provisions project connections.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/modules/acr.bicep Adds Bicep ACR module.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/main.bicep Adds greenfield template.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/brownfield.bicep Adds existing-project template.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/brownfield.arm.json Embeds compiled brownfield ARM.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/abbreviations.json Defines resource abbreviations.
cli/azd/extensions/azure.ai.projects/internal/synthesis/templates_embed.go Embeds provisioning templates.
cli/azd/extensions/azure.ai.projects/internal/synthesis/synthesizer.go Adds configuration synthesis.
cli/azd/extensions/azure.ai.projects/internal/synthesis/schema_test.go Tests schema and ARM parity.
cli/azd/extensions/azure.ai.projects/internal/synthesis/parity_test.go Enforces Agents synthesis parity.
cli/azd/extensions/azure.ai.projects/internal/provisioning/resource_group_location_check.go Moves location validation.
cli/azd/extensions/azure.ai.projects/internal/provisioning/resource_group_location_check_validate_test.go Ports validation tests.
cli/azd/extensions/azure.ai.projects/internal/provisioning/resource_group_location_check_test.go Ports location tests.
cli/azd/extensions/azure.ai.projects/internal/provisioning/provisioning_provider.go Defines provider constants.
cli/azd/extensions/azure.ai.projects/internal/provisioning/preview_helpers.go Moves preview helpers.
cli/azd/extensions/azure.ai.projects/internal/provisioning/preview_helpers_test.go Ports preview tests.
cli/azd/extensions/azure.ai.projects/internal/provisioning/ondisk_template.go Moves on-disk template support.
cli/azd/extensions/azure.ai.projects/internal/provisioning/ondisk_template_test.go Ports template tests.
cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider.go Moves the Foundry provider.
cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider_test.go Ports provider tests.
cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider_resolveenv_test.go Tests environment resolution.
cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider_destroy_confirm_test.go Tests destroy confirmation.
cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider_brownfield_acr_test.go Tests brownfield ACR.
cli/azd/extensions/azure.ai.projects/internal/provisioning/contract_parity_test.go Enforces migration contract parity.
cli/azd/extensions/azure.ai.projects/internal/exterrors/errors.go Adds provider error helpers.
cli/azd/extensions/azure.ai.projects/internal/exterrors/codes.go Adds provisioning error codes.
cli/azd/extensions/azure.ai.projects/internal/cmd/version.go Uses shared version metadata.
cli/azd/extensions/azure.ai.projects/internal/cmd/service_target.go Updates ownership documentation.
cli/azd/extensions/azure.ai.projects/internal/cmd/root.go Registers providers and handlers.
cli/azd/extensions/azure.ai.projects/internal/cmd/project_service_config.go Projects deployment environment data.
cli/azd/extensions/azure.ai.projects/internal/cmd/project_service_config_test.go Tests lifecycle projection.
cli/azd/extensions/azure.ai.projects/internal/cmd/ownership_test.go Tests extension ownership metadata.
cli/azd/extensions/azure.ai.projects/internal/azure/client_options.go Configures Azure SDK clients.
cli/azd/extensions/azure.ai.projects/go.sum Updates dependency checksums.
cli/azd/extensions/azure.ai.projects/go.mod Adds provisioning dependencies.
cli/azd/extensions/azure.ai.projects/extension.yaml Declares provider ownership.
cli/azd/extensions/azure.ai.projects/cspell.yaml Adds spelling terms.
cli/azd/extensions/azure.ai.projects/ci-build.ps1 Updates CI linker metadata.
cli/azd/extensions/azure.ai.projects/CHANGELOG.md Adds Projects release notes.
cli/azd/extensions/azure.ai.projects/build.sh Updates Unix linker metadata.
cli/azd/extensions/azure.ai.projects/build.ps1 Updates Windows linker metadata.
cli/azd/extensions/azure.ai.projects/AGENTS.md Documents ownership and release flow.
cli/azd/extensions/azure.ai.agents/version.txt Bumps Agents version.
cli/azd/extensions/azure.ai.agents/README.md Documents transferred ownership.
cli/azd/extensions/azure.ai.agents/internal/project/provisioning_provider.go Updates provider ownership comment.
cli/azd/extensions/azure.ai.agents/internal/cmd/resource_services.go Retains legacy deployment fallback.
cli/azd/extensions/azure.ai.agents/internal/cmd/resource_services_test.go Tests split and legacy behavior.
cli/azd/extensions/azure.ai.agents/internal/cmd/listen.go Removes provider registration.
cli/azd/extensions/azure.ai.agents/extension.yaml Adds Projects dependency.
cli/azd/extensions/azure.ai.agents/docs/private-networking.md Updates networking ownership docs.
cli/azd/extensions/azure.ai.agents/CHANGELOG.md Adds Agents release notes.
cli/azd/extensions/azure.ai.agents/AGENTS.md Documents coordinated release flow.

Comment thread cli/azd/extensions/azure.ai.projects/CHANGELOG.md Outdated
Comment thread cli/azd/extensions/azure.ai.agents/CHANGELOG.md Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/synthesizer.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/cmd/project_service_config.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/synthesizer.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/main.bicep Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/synthesizer.go Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 10:38
@huimiu huimiu requested a review from danieljurek as a code owner July 14, 2026 10:38
@github-actions github-actions Bot added the area/extensions Extensions (general) label Jul 14, 2026

@jongio jongio left a comment

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.

One test-coverage gap worth closing on the new synthesizer.

Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/synthesizer.go Outdated

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

Copilot reviewed 67 out of 68 changed files in this pull request and generated 8 comments.

Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/synthesizer.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/synthesizer.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/cmd/project_service_config.go Outdated
Comment thread cli/azd/extensions/azure.ai.projects/CHANGELOG.md Outdated
Comment thread cli/azd/extensions/azure.ai.agents/CHANGELOG.md Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/templates/main.bicep Outdated
Comment thread cli/azd/extensions/azure.ai.projects/internal/synthesis/synthesizer.go Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 11:02

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

Copilot reviewed 76 out of 77 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider.go:892

  • [azd-code-reviewer] ARM deployment parameter objects use value even when the template parameter is securestring; secureValue is not part of the deployments REST schema. Because this map is sent directly through armresources.Deployment, every brownfield reconcile includes an invalid connections parameter and can be rejected before deployment. Keep the template parameter marked @secure(), but send its value in the standard envelope.
    cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider.go:157
  • [azd-code-reviewer] The provider now recognizes an endpoint loaded through $ref, but the provision validation gate still classifies brownfield projects with foundryServiceEndpoint(rawYAML, svcName), which does not resolve references. A ref-based brownfield project can therefore be treated as greenfield and blocked by the resource-group location check before Initialize reaches this code. Update the validation check to use synthesis.ProjectEndpoint with the project path as well.
    cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider.go:1754
  • secureValue is not a valid ARM deployment parameter envelope for the deployments REST API; secure template parameters should still be supplied with the standard { "value": ... } wrapper. Because synthesis always includes connections, greenfield provisioning can send an invalid parameter object even when the connection list is empty.

@jongio jongio left a comment

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.

Re-reviewed the latest push. The sibling $ref resolution I flagged is now handled through loadProjectService, with projectRoot threaded into deriveIncludeAcr and collectConnections, so agents and connections declared via a service-level $ref are resolved before decoding. The gRPC project-config path resolves refs too, and connections now flows as a @secure() JSON parameter end to end. Tests cover both the ref-resolution and secure-parameter paths.

Copilot AI review requested due to automatic review settings July 14, 2026 15:05
@huimiu huimiu force-pushed the hui/own-ai-project-service branch from 0695ccf to c2ba868 Compare July 14, 2026 15:15

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

Copilot reviewed 76 out of 77 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/test-ext-azure-ai-agents.yml
Comment thread cli/azd/extensions/azure.ai.projects/extension.yaml
Copilot AI review requested due to automatic review settings July 14, 2026 15:15

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

Copilot reviewed 76 out of 77 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

cli/azd/extensions/azure.ai.projects/internal/provisioning/foundry_provisioning_provider.go:157

  • azd-code-reviewer: This ref-aware endpoint lookup is inconsistent with ResourceGroupLocationCheck.isBrownfieldFoundryProject, which still calls foundryServiceEndpoint on the raw YAML. When endpoint comes from a service $ref (a case now covered by the synthesizer tests), provision validation treats the project as greenfield and can block on an unrelated resource-group location mismatch before this provider runs. Use the same ref-aware resolver in the validation check and cover that gate with a test.

capacity: 50
```

When `endpoint` is omitted, `azd provision` creates a Foundry account and project. When it is set, provisioning reuses that project and reconciles the declarations that can be applied to an existing account.
Comment on lines +61 to +67
run: |
pwsh -File ci-build.ps1 -OutputFileName azure-ai-projects-linux-amd64 -Version "$(cat version.txt | tr -d '\r\n')"
mkdir -p bin
mv azure-ai-projects-linux-amd64 bin/
azd x pack
azd x publish
azd extension install azure.ai.projects --source local --force --no-prompt
Copilot AI review requested due to automatic review settings July 14, 2026 15:28

@jongio jongio left a comment

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.

Re-reviewed the 3 new commits since my last approval. The connections parameter now uses the value envelope instead of secureValue, which is the valid ARM parameter key, so the value actually reaches the deployment. Security is still enforced by @secure() on the connections param in both main.bicep and brownfield.bicep, so nothing leaks in deployment history. Tests cover the new envelope, and the agents workflow now runs the projects unit tests.

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

Copilot reviewed 76 out of 77 changed files in this pull request and generated 1 comment.

Comment on lines +30 to +33
sanitized_env_name = trim(
replace(lower(coalesce(var.environment_name, "")), "/[^a-z0-9-]/", "-"),
"-",
)
description: Ship agents with Microsoft Foundry from your terminal. (Beta)
usage: azd ai agent <command> [options]
# NOTE: Make sure version.txt is in sync with this version.
version: 1.0.0-beta.5

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.

Why are we doing a version bump as a part of this PR?

// FoundryProviderName is the value written to `infra.provider` in
// azure.yaml by `azd ai agent init` and looked up by azd's provider
// resolver to dispatch provisioning to this extension.
// resolver to dispatch provisioning to azure.ai.projects.

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.

If provisioning is being handled by azure.ai.projects, what is this file for?

param connections connectionsType = []
@description('JSON-encoded Foundry project connections to create.')
@secure()
param connections string = ''

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.

Why is the handling here needing to change?

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.

[Task] Coordinate Foundry provider handoff release

4 participants