Background
PR #8292 introduced a two-step Foundry project selection flow in both init.go and init_from_code.go. The two files now share ~70 lines of near-identical logic:
ensureSubscription → selectFoundryProject → nil check → setEnvValue("USE_EXISTING_AI_PROJECT") → fallback to "create new"
Problem
Future fixes may drift between the two files if only one is updated.
Proposed Solution
Extract a shared helper function (e.g. promptOrSelectFoundryProject(...)) that encapsulates the common sequence, and have both callers use it.
Files
cli/azd/extensions/azure.ai.agents/internal/cmd/init.go (~L1182-1250)
cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go (~L520-590)
Priority
P3 — non-blocking polish, suggested by @wbreza in PR #8292 review.
Background
PR #8292 introduced a two-step Foundry project selection flow in both
init.goandinit_from_code.go. The two files now share ~70 lines of near-identical logic:Problem
Future fixes may drift between the two files if only one is updated.
Proposed Solution
Extract a shared helper function (e.g.
promptOrSelectFoundryProject(...)) that encapsulates the common sequence, and have both callers use it.Files
cli/azd/extensions/azure.ai.agents/internal/cmd/init.go(~L1182-1250)cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go(~L520-590)Priority
P3 — non-blocking polish, suggested by @wbreza in PR #8292 review.