Skip to content

finetune ext: honor --endpoint and --subscription flags over configured environment#7243

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-extension-endpoint-subscription
Draft

finetune ext: honor --endpoint and --subscription flags over configured environment#7243
Copilot wants to merge 2 commits intomainfrom
copilot/fix-extension-endpoint-subscription

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

The jobs subcommands silently ignored --project-endpoint and --subscription flags whenever an azd environment was already configured, making it impossible to query fine-tuning jobs across different projects without re-running init.

Changes

Priority fix (internal/cmd/validation.go)

  • validateOrInitEnvironment now applies: explicit flags → env vars → error (previously: env vars → warn-and-ignore-flags)
  • Removed the implicit-init code path and the now-unused sanitizeEnvironmentName helper

Flag-aware client creation (internal/cmd/operations.go)

  • Added resolveFineTuningProvider(ctx, flags, azdClient) — uses flags when set, falls back to env
  • Added createFineTuningService wrapping the above
  • All subcommand constructors (submit, show, list, pause, resume, cancel, deploy) now receive *jobsFlags and use these helpers instead of calling services.NewFineTuningService directly
  • deploy additionally applies flag overrides for subscription ID, account name (parsed from endpoint), and tenant lookup

New factory/service constructors

  • factory.NewFineTuningProviderWithEndpoint(endpoint, tenantId) — builds an OpenAI client from a bare endpoint URL + tenant, no env lookup
  • services.NewFineTuningServiceWithProvider(provider, stateStore) — constructs a service from a pre-built provider

Version bump: 0.0.17-preview0.0.18-preview

Behavior

# Before: flags silently ignored if env already configured
azd ai finetuning jobs list -e https://other-account.services.ai.azure.com/api/projects/other-project -s <sub-id>
# Warning: Environment is already configured. Flags are being ignored.

# After: flags take priority
azd ai finetuning jobs list -e https://other-account.services.ai.azure.com/api/projects/other-project -s <sub-id>
# Lists jobs from the specified project endpoint, not the configured env
Original prompt

This section details on the original issue you should resolve

<issue_title>Finetune Extension not honoring endpoint & subscription flag</issue_title>
<issue_description>Searching fine tuning jobs across is not possible because, extension create environment on the first interaction and post that it does not consider endpoint and subscription flags which make it very difficult to work across projects.</issue_description>

<agent_instructions>expected behavior or priority list

  • If user provide endpoint and subscription in command use it
  • If not, use environment variables.
  • If environment variables are also missing, use interactive flow.
    You need to fix the versions and change log as well.</agent_instructions>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix finetune extension not honoring endpoint and subscription flag finetune ext: honor --endpoint and --subscription flags over configured environment Mar 23, 2026
Copilot AI requested a review from achauhan-scc March 23, 2026 05:09
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.

Finetune Extension not honoring endpoint & subscription flag

2 participants