Skip to content

Comments

Simplify azd ai agent/finetuning init to use --minimal flag#6670

Merged
achauhan-scc merged 6 commits intomainfrom
copilot/simplify-finetuning-init-command
Feb 1, 2026
Merged

Simplify azd ai agent/finetuning init to use --minimal flag#6670
achauhan-scc merged 6 commits intomainfrom
copilot/simplify-finetuning-init-command

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

When no azd project exists, azd ai agent init and azd ai finetuning init call azd init interactively, presenting users with three confusing options ("Scan current directory", "Select a template", "Use agent mode"), which users may not know what to pick.

This PR simplifies this flow by defaulting to azd init --minimal, effectively reducing the number of init/env-related prompts from 4 to 2:

image

Changes

  • Both extensions: Changed ensureProject to call azd init --minimal instead of azd init
  • Removed -e environment flag from init call (not supported by --minimal; environment creation already handled separately in ensureEnvironment)
// Before
initArgs := []string{"init"}
if flags.env != "" {
    initArgs = append(initArgs, "-e", flags.env)
}

// After
initArgs := []string{"init", "--minimal"}
  • azure.ai.finetune - suppress Warning: failed to get existing environment log message

Environment handling continues to work via the existing ensureEnvironment function which runs azd env new after project initialization.

Original prompt

This section details on the original issue you should resolve

<issue_title>AI extensions - consider simplifying azd ai agent/finetuning init to call azd init --minimal</issue_title>
<issue_description>Currently, if there's no azd project detected, azd ai agent/finetuning init calls azd init interactively, which presents 3 options:
Image

We've gotten feedback it's not clear what users should pick here</issue_description>

<agent_instructions>When running 'azd init --minimal', the -e / --environment flag won't do anything, so we'll need to handle env creation separately.

Make changes to both azure.ai.finetune and azure.ai.agents extensions</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 30, 2026 22:50
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot AI changed the title [WIP] Simplify azd ai agent/finetuning init command Simplify azd ai agent/finetuning init to use --minimal flag Jan 30, 2026
Copilot AI requested a review from JeffreyCA January 30, 2026 22:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the initialization flow for AI extensions (azd ai agent init and azd ai finetuning init) by using the --minimal flag when calling azd init, avoiding confusing interactive prompts that ask users to choose between "Scan current directory", "Select a template", or "Use agent mode".

Changes:

  • Modified both extensions to call azd init --minimal instead of azd init
  • Removed the -e environment flag from init calls (not supported by --minimal; environment creation is handled separately via ensureEnvironment)
  • Refactored getExistingEnvironment in finetune extension to suppress warning messages by silently handling lookup errors

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
cli/azd/extensions/azure.ai.finetune/internal/cmd/init.go Updated ensureProject to use --minimal flag; refactored getExistingEnvironment to return only environment (no error) and silently ignore lookup failures; removed warning log in ensureEnvironment
cli/azd/extensions/azure.ai.finetune/go.mod Moved stretchr/testify from indirect to direct dependency (used in tests)
cli/azd/extensions/azure.ai.agents/internal/cmd/init.go Updated ensureProject to use --minimal flag and removed -e environment flag
.gitignore Added binary output files for azure.ai.finetune extension

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@achauhan-scc achauhan-scc merged commit cb3b765 into main Feb 1, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI extensions - consider simplifying azd ai agent/finetuning init to call azd init --minimal

5 participants