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
[ext-agents]: azd ai agent init should adopt the sample's azure.yaml, not scaffold/clone from azd-ai-starter-basic (unified azure.yaml + bicep-less) #8798
Today azd ai agent init points at an agent manifest (agent.manifest.yaml) and generates/scaffolds the project-root azure.yaml (and, on main, an infra/ directory cloned from Azure-Samples/azd-ai-starter-basic). Any azure.yaml that ships in the sample is downloaded into the agent's src/<agent-id>/ subfolder and ignored by azd.
Under the unified azure.yaml work on huimiu/foundry-azure-yaml, this needs to change. init will no longer point to an agent manifest -- samples will ship their configuration as a complete unified azure.yaml (host: microsoft.foundry). init should consume the sample's azure.yaml as the project manifest instead of scaffolding/cloning its own, and it should stop downloading infra/ + azure.yaml from azd-ai-starter-basic, because bicep-less provisioning (infra.provider: microsoft.foundry) is the default under the unified work (#8643).
Current behavior (on main)
ensureProject finds no existing project, so it runs azd init -t Azure-Samples/azd-ai-starter-basic <targetDir>, which scaffolds the project-rootazure.yaml + infra/ from the starter repo, then chdirs into it. (cli/azd/extensions/azure.ai.agents/internal/cmd/init.go, ensureProject ~L1489-1544; starter template at ~L1517-1518)
For hosted/container agents, downloadParentDirectory downloads the entire remote manifest folder (no filename filtering) into src/<agent-id>/ -- including the sample's own azure.yaml, which lands at src/<agent-id>/azure.yaml and is never read by azd (azd only reads the project-root azure.yaml). (init.godownloadAgentYaml ~L2472-2495, downloadParentDirectory / downloadDirectoryContents ~L3120-3222)
The agent is wired in via Project().AddService(), which appends a service entry to the project-root azure.yaml. (init.goaddToProject ~L2691; host gRPC handler cli/azd/internal/grpcserver/project_service.goAddService ~L181-232)
Net result: two azure.yaml files -- the scaffolded project-root one (used) and the sample's copy buried under src/<agent-id>/ (unused).
Note: #8643 (already merged into huimiu/foundry-azure-yaml) replaced the azd-ai-starter-basic clone with an azd init -t <emptyStagedDir> scaffold plus a generated bicep-less azure.yaml (infra.provider: microsoft.foundry). That removed the starter infra/ clone, but init still generates the project azure.yaml rather than adopting the sample's.
Why this needs to change
The unified azure.yaml direction (#8676, #8773, #8709, #8710, and the huimiu/foundry-azure-yaml base branch):
init no longer points to an agent.manifest.yaml; agent.yaml / agent.manifest.yaml are retired in favor of a single unified azure.yaml using host: microsoft.foundry.
Samples will therefore ship a complete unified azure.yaml that already declares the project, model deployments, connections, toolboxes, and agent(s).
Continuing to scaffold/generate a project azure.yaml (or clone one from the starter repo) and bury the sample's azure.yaml under src/<agent-id>/ is wrong under this model: the sample's azure.yaml is the source of truth.
Proposed behavior
When initializing from a sample/URL that ships a unified azure.yaml:
Use the sample's azure.yaml as the project-root manifest (place it at the project root) instead of scaffolding from azd-ai-starter-basic or generating a new one.
Do not download/clone infra/ + azure.yaml from azd-ai-starter-basic; rely on bicep-less provisioning (infra.provider: microsoft.foundry) by default.
Do not leave an unused/duplicate azure.yaml under src/<agent-id>/.
Preserve existing-project behavior: if a project-root azure.yaml already exists on disk, do not overwrite it (merge/add as appropriate).
Summary
Today
azd ai agent initpoints at an agent manifest (agent.manifest.yaml) and generates/scaffolds the project-rootazure.yaml(and, onmain, aninfra/directory cloned fromAzure-Samples/azd-ai-starter-basic). Anyazure.yamlthat ships in the sample is downloaded into the agent'ssrc/<agent-id>/subfolder and ignored by azd.Under the unified
azure.yamlwork onhuimiu/foundry-azure-yaml, this needs to change.initwill no longer point to an agent manifest -- samples will ship their configuration as a complete unifiedazure.yaml(host: microsoft.foundry).initshould consume the sample'sazure.yamlas the project manifest instead of scaffolding/cloning its own, and it should stop downloadinginfra/+azure.yamlfromazd-ai-starter-basic, because bicep-less provisioning (infra.provider: microsoft.foundry) is the default under the unified work (#8643).Current behavior (on
main)ensureProjectfinds no existing project, so it runsazd init -t Azure-Samples/azd-ai-starter-basic <targetDir>, which scaffolds the project-rootazure.yaml+infra/from the starter repo, thenchdirs into it. (cli/azd/extensions/azure.ai.agents/internal/cmd/init.go,ensureProject~L1489-1544; starter template at ~L1517-1518)downloadParentDirectorydownloads the entire remote manifest folder (no filename filtering) intosrc/<agent-id>/-- including the sample's ownazure.yaml, which lands atsrc/<agent-id>/azure.yamland is never read by azd (azd only reads the project-rootazure.yaml). (init.godownloadAgentYaml~L2472-2495,downloadParentDirectory/downloadDirectoryContents~L3120-3222)Project().AddService(), which appends a service entry to the project-rootazure.yaml. (init.goaddToProject~L2691; host gRPC handlercli/azd/internal/grpcserver/project_service.goAddService~L181-232)Net result: two
azure.yamlfiles -- the scaffolded project-root one (used) and the sample's copy buried undersrc/<agent-id>/(unused).Why this needs to change
The unified
azure.yamldirection (#8676, #8773, #8709, #8710, and thehuimiu/foundry-azure-yamlbase branch):initno longer points to anagent.manifest.yaml;agent.yaml/agent.manifest.yamlare retired in favor of a single unifiedazure.yamlusinghost: microsoft.foundry.azure.yamlthat already declares the project, model deployments, connections, toolboxes, and agent(s).infra/(or a separateazure.yaml) fromazd-ai-starter-basic.Continuing to scaffold/generate a project
azure.yaml(or clone one from the starter repo) and bury the sample'sazure.yamlundersrc/<agent-id>/is wrong under this model: the sample'sazure.yamlis the source of truth.Proposed behavior
When initializing from a sample/URL that ships a unified
azure.yaml:azure.yamlas the project-root manifest (place it at the project root) instead of scaffolding fromazd-ai-starter-basicor generating a new one.infra/+azure.yamlfromazd-ai-starter-basic; rely on bicep-less provisioning (infra.provider: microsoft.foundry) by default.azure.yamlundersrc/<agent-id>/.azure.yamlalready exists on disk, do not overwrite it (merge/add as appropriate).Notes / open questions
azure.yaml(backward compatibility): generate the bicep-less unifiedazure.yamlas feat(agents): bicep-less init for azd ai agent init #8643 does today.azure.yamlshould already contain theazure.ai.project/azure.ai.connection/azure.ai.toolbox+ agent service entries, soinitshould not re-derive them.--src,--agent-name, and folder-naming interact when the sample'sazure.yamlalready names services / paths.Related