You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ai): conditionally export AKS Bicep infrastructure - #10915
Select Bicep export mode from synthesized agentHosting, independently of the BYO AKS preview switch.
Omit AKS-only parameters, preview account resources, and byo-* modules from non-AKS exports while preserving networking, monitoring, registry selection, custom modules, and existing-project paths.
Share .bicep.tmpl sources between conditional exports and generation of the complete embedded provisioning graph. Full-mode Bicep and generated ARM JSON remain unchanged.
Go 1.26.4: standalone synthesis go test ./... -count=1.
Agents: go test ./internal/cmd ./internal/project -count=1.
Projects parent module: go test ./... -count=1.
Native Bicep 0.48.1 compilation, including seven greenfield export cases and existing-project registry modes; generated parameter names match compiled declarations.
go generate reproduces the current full Bicep and ARM JSON without changes.
golangci-lint 2.11.4: synthesis and affected Agents packages, zero issues; changed Go files are gofmt-clean. go fix -diff reports only an unrelated pre-existing modernization in synthesis/monitoring_discovery_test.go; no changes were applied there.
No Azure deployment or interactive scenario was run. Relevant optional offline scenario: cli/azd/extensions/azure.ai.agents/tests/cli-interactive-tester-scenarios/tier0/0.34-init-byo-aks-infra.yaml, through the foundry-extension-scenario-orchestrator agent.
Render shared Bicep sources according to synthesized agent hosting while retaining the complete embedded provisioning graph.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Azure Pipelines:
Successfully started running 3 pipeline(s).
24 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
The reason will be displayed to describe this comment to others. Learn more.
π‘ Changes recommended
The Projects Bicep exporter still emits the full AKS graph and raw template sources for non-AKS projects, while documentation omits the regeneration and parameter requirements for enabling AKS after export.
This PR makes the Agents extensionβs Foundry Bicep export conditional on AKS hosting, while sharing template sources with Projectsβ embedded provisioning graph.
Changes:
Omit AKS-only parameters, resources, and modules from non-AKS Agents exports.
Generate the full embedded Bicep graph from shared conditional templates.
Expand export and parity tests, and document export modes and regeneration.
Clarify behavior of Bicep eject with AKS parameters and agentHosting configuration. Explain requirements for non-AKS Bicep export and BYO AKS deployment.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
π΅ Needs a closer look
The Projects Bicep exporter lacks hosting-aware rendering and filtering, causing it to copy raw .bicep.tmpl files and include AKS-only infrastructure in non-AKS exports.
No open issues π
3 previously missed issues
In code that hasn't changed since last review
Reject AKS configuration unsupported by the exported graph
After a non-AKS export, adding agentHosting to azure.yaml is silently ignored, so provisioning can succeed without using the selected AKS cluster. This conflicts with cli/azd/extensions/AGENTS.md:87-89, which requires rejecting unsupported authored configuration. Detect this mismatch before provisioning and return an error explaining that the exported graph needs AKS support.
Render and filter Bicep templates in the Projects exporter
Projects Bicep eject still copies TemplatesFS() verbatim through copyEmbeddedBicep in azure.ai.projects/internal/cmd/project_add.go:2169. It now writes raw .bicep.tmpl files and still gives non-AKS projects the full AKS graph, contrary to the new documented eject behavior. Apply the same synthesized-hosting selection, rendering, and filtering to that exporter.
Tell contributors to edit the Bicep template sources
The first generation step overwrites main.bicep, modules/resources.bicep, and modules/acr.bicep from their .bicep.tmpl sources, so following this advice after editing those .bicep files discards the edits. State explicitly that contributors must edit the corresponding .tmpl files; only non-generated .bicep files should be edited directly.
The reason will be displayed to describe this comment to others. Learn more.
π‘ Changes recommended
An authored agentHosting setting can be silently discarded when the template lacks support, allowing provisioning to succeed on Foundry hosting instead of the selected AKS cluster.
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
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
agentHosting, independently of the BYO AKS preview switch.byo-*modules from non-AKS exports while preserving networking, monitoring, registry selection, custom modules, and existing-project paths..bicep.tmplsources between conditional exports and generation of the complete embedded provisioning graph. Full-mode Bicep and generated ARM JSON remain unchanged.Related to #10864.
Validation
go test ./... -count=1.go test ./internal/cmd ./internal/project -count=1.go test ./... -count=1.go generatereproduces the current full Bicep and ARM JSON without changes.go fix -diffreports only an unrelated pre-existing modernization insynthesis/monitoring_discovery_test.go; no changes were applied there.No Azure deployment or interactive scenario was run. Relevant optional offline scenario:
cli/azd/extensions/azure.ai.agents/tests/cli-interactive-tester-scenarios/tier0/0.34-init-byo-aks-infra.yaml, through thefoundry-extension-scenario-orchestratoragent.