From d8204403faa6c7711172fd0968243f82cefb0978 Mon Sep 17 00:00:00 2001 From: John Miller Date: Tue, 31 Mar 2026 08:34:51 -0400 Subject: [PATCH 1/3] temporary template location --- .../azure.ai.agents/internal/cmd/init_from_templates_helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go b/cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go index d625152183d..e894a7b78a3 100644 --- a/cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go +++ b/cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go @@ -21,7 +21,7 @@ import ( "github.com/fatih/color" ) -const agentTemplatesURL = "https://aka.ms/foundry-agents" +const agentTemplatesURL = "https://raw.githubusercontent.com/therealjohn/awesome-azd/refs/heads/agent-tooling-templates/website/static/agent-templates.json" // Template type constants const ( From f92268e85f5f7321aadc487c36588d9d9947edf0 Mon Sep 17 00:00:00 2001 From: John Miller Date: Tue, 31 Mar 2026 09:03:55 -0400 Subject: [PATCH 2/3] feat: enhance model configuration handling for agent creation with project ID support. Fixes #7409 --- .../azure.ai.agents/internal/cmd/init.go | 44 +++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go b/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go index 9d17d200a9c..3e698c84710 100644 --- a/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go +++ b/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go @@ -545,16 +545,44 @@ func (a *InitAction) configureModelChoice( } // If the manifest has no model resources, skip the model configuration prompt - // but still ensure subscription and location are set for agent creation + // but still ensure subscription and location are set for agent creation. + // When --project-id is provided, use the existing project to derive location + // and configure Foundry env vars (ACR, AppInsights, etc.) instead of prompting. if !manifestHasModelResources(agentManifest) { - newCred, err := ensureSubscriptionAndLocation( - ctx, a.azdClient, a.azureContext, a.environment.Name, - "Select an Azure subscription to provision your agent and Foundry project resources.", - ) - if err != nil { - return nil, err + if a.flags.projectResourceId != "" { + newCred, err := ensureSubscription( + ctx, a.azdClient, a.azureContext, a.environment.Name, + "Select an Azure subscription to provision your agent and Foundry project resources.", + ) + if err != nil { + return nil, err + } + a.credential = newCred + + selectedProject, err := selectFoundryProject( + ctx, a.azdClient, a.credential, a.azureContext, a.environment.Name, + a.azureContext.Scope.SubscriptionId, a.flags.projectResourceId, + ) + if err != nil { + return nil, err + } + + if selectedProject == nil { + if err := ensureLocation(ctx, a.azdClient, a.azureContext, a.environment.Name); err != nil { + return nil, err + } + } + } else { + newCred, err := ensureSubscriptionAndLocation( + ctx, a.azdClient, a.azureContext, a.environment.Name, + "Select an Azure subscription to provision your agent and Foundry project resources.", + ) + if err != nil { + return nil, err + } + a.credential = newCred } - a.credential = newCred + return agentManifest, nil } From 485ce66bb21f4d2fcc36c1bb486f12602e656b66 Mon Sep 17 00:00:00 2001 From: Jeffrey Chen Date: Mon, 6 Apr 2026 22:41:20 +0000 Subject: [PATCH 3/3] Address feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cli/azd/extensions/azure.ai.agents/internal/cmd/init.go | 4 +--- .../internal/cmd/init_from_templates_helpers.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go b/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go index 3e698c84710..e207a88f85a 100644 --- a/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go +++ b/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go @@ -568,9 +568,7 @@ func (a *InitAction) configureModelChoice( } if selectedProject == nil { - if err := ensureLocation(ctx, a.azdClient, a.azureContext, a.environment.Name); err != nil { - return nil, err - } + return nil, fmt.Errorf("foundry project not found: %s", a.flags.projectResourceId) } } else { newCred, err := ensureSubscriptionAndLocation( diff --git a/cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go b/cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go index e894a7b78a3..d625152183d 100644 --- a/cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go +++ b/cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go @@ -21,7 +21,7 @@ import ( "github.com/fatih/color" ) -const agentTemplatesURL = "https://raw.githubusercontent.com/therealjohn/awesome-azd/refs/heads/agent-tooling-templates/website/static/agent-templates.json" +const agentTemplatesURL = "https://aka.ms/foundry-agents" // Template type constants const (