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
Audit and migrate the remaining first-party extensions in cli/azd/extensions/ to use azdext.NewExtensionRootCommand (introduced in #6856), and remove flags that conflict with azd's reserved global flag set (internal/reserved_flags.go). This is the same migration completed for azure.ai.agents in #7796 / PR #7950, generalized to the rest of the 1P fleet.
This issue covers all first-party extensions in one PR except microsoft.azd.extensions, which has additional surface area (scaffolding templates, --cwd semantic collision) and is tracked separately in #7951.
Conflicts to fix
Extension
Conflicts
Notes
azure.ai.finetune
manual root --debug, --no-prompt; init --environment (long-name only, short is -n); operations--output/-o (×2)
uses rootFlagsDefinition global pattern
azure.ai.models
manual root --debug, --no-prompt; init --environment (long-name only, short is -n); custom show --output/-o; custom list --output/-o
uses rootFlagsDefinition global pattern
azure.appservice
manual root --debug, --no-prompt
uses rootFlagsDefinition global pattern
azure.coding-agent
manual root --debug
minimal extension
microsoft.azd.concurx
manual root --debug; up --debug (subcommand)
duplicate registration on up
microsoft.azd.demo
none directly, but custom root (no SDK)
should still adopt NewExtensionRootCommand for consistency
PersistentPreRunE chains: remove any cmd.PersistentPreRunE that manually invokes parent.PersistentPreRunE / root.PersistentPreRunE — NewExtensionRootCommand sets cobra.EnableTraverseRunHooks = true, so the SDK pre-run already runs from root → leaf and double-invocation is wrong.
requiredAzdVersion in extension.yaml: bump to a version that ships the SDK enforcement so users on older azd see a clear install-time error rather than a runtime conflict.
Validation
Per extension touched:
cd cli/azd/extensions/<extension>
go build ./... && go test ./...
azd x build
azd <namespace> --help
Plus go test ./cli/azd/pkg/azdext/... for ValidateNoReservedFlagConflicts coverage.
Summary
Audit and migrate the remaining first-party extensions in
cli/azd/extensions/to useazdext.NewExtensionRootCommand(introduced in #6856), and remove flags that conflict with azd's reserved global flag set (internal/reserved_flags.go). This is the same migration completed forazure.ai.agentsin #7796 / PR #7950, generalized to the rest of the 1P fleet.Reserved flags to remove:
--debug,--no-prompt,--cwd,--environment(-e),--output(-o),--help(-h),--docs,--trace-log-file,--trace-log-url.Scope
This issue covers all first-party extensions in one PR except
microsoft.azd.extensions, which has additional surface area (scaffolding templates,--cwdsemantic collision) and is tracked separately in #7951.Conflicts to fix
azure.ai.finetune--debug,--no-prompt;init --environment(long-name only, short is-n);operations--output/-o(×2)rootFlagsDefinitionglobal patternazure.ai.models--debug,--no-prompt;init --environment(long-name only, short is-n);custom show --output/-o;custom list --output/-orootFlagsDefinitionglobal patternazure.appservice--debug,--no-promptrootFlagsDefinitionglobal patternazure.coding-agent--debugmicrosoft.azd.concurx--debug;up --debug(subcommand)upmicrosoft.azd.demoNewExtensionRootCommandfor consistencyAlready migrated
azure.ai.agents— done in azure.ai.agents: adopt NewExtensionRootCommand and remove reserved global flag conflicts #7796 / PR 1P extensions: migrate toazdext.NewExtensionRootCommandand remove reserved flag conflicts #7950Tracked separately
microsoft.azd.extensions— see microsoft.azd.extensions: migrate toNewExtensionRootCommandand refresh scaffolding templates #7951 (extension + scaffolding templates +--cwdrename)Stub / non-Go / dead — skip
azure.ai.customtraining— binary-only stub (no Go source)azd.internal.pack— meta-package (no commands)microsoft.azd.ai.builder— dead extension, not maintainedMigration template (per extension)
Mirror what was done for
azure.ai.agentsin #7796:Root: replace bespoke
cobra.Command{}+rootFlagsDefinitionpattern with:Drop manual
--debug/--no-promptregistrations and anyAZD_*env-var fallback. Thread*azdext.ExtensionContextto subcommand constructors.init --environment: drop the local flag where present (azure.ai.finetune,azure.ai.models). ReadextCtx.Environmentinstead.--output/-o: replace per-subcommand redeclarations withazdext.RegisterFlagOptions(azdext: addRegisterFlagOptionsfor per-subcommand flag config #7826) and readextCtx.OutputFormatinRunE. Per-command default + allowed values are expressed declaratively.PersistentPreRunEchains: remove anycmd.PersistentPreRunEthat manually invokesparent.PersistentPreRunE/root.PersistentPreRunE—NewExtensionRootCommandsetscobra.EnableTraverseRunHooks = true, so the SDK pre-run already runs from root → leaf and double-invocation is wrong.go.modbump: extensions in their own modules (azure.ai.finetune,azure.ai.models,azure.appservice,azure.coding-agent,microsoft.azd.concurx) need a bump to the SDK version that includesRegisterFlagOptions(azdext: addRegisterFlagOptionsfor per-subcommand flag config #7826) +EnableTraverseRunHooks+ the reserved-flag registry (Add reserved global flags registry for extensions #7312). The monorepo extension (microsoft.azd.demo) follows the parentcli/azdmodule automatically.requiredAzdVersioninextension.yaml: bump to a version that ships the SDK enforcement so users on older azd see a clear install-time error rather than a runtime conflict.Validation
Per extension touched:
Plus
go test ./cli/azd/pkg/azdext/...forValidateNoReservedFlagConflictscoverage.Out of scope
azure.ai.agents(already migrated via azure.ai.agents: adopt NewExtensionRootCommand and remove reserved global flag conflicts #7796 / PR 1P extensions: migrate toazdext.NewExtensionRootCommandand remove reserved flag conflicts #7950)microsoft.azd.extensions(tracked in microsoft.azd.extensions: migrate toNewExtensionRootCommandand refresh scaffolding templates #7951)microsoft.azd.ai.builder(dead extension)NewExtensionRootCommandAPI surfaceRelated
azure.ai.agentsmigration (precedent + template)NewExtensionRootCommandand refresh scaffolding templates #7951 —microsoft.azd.extensionsmigration (separate due to scaffolding scope)RegisterFlagOptionsfor per-subcommand flag config #7826 —azdext.RegisterFlagOptionsazdext.NewExtensionRootCommandcli/azd/docs/extensions/extensions-style-guide.md— Reserved Global Flags sectioncli/azd/docs/design/extension-flag-architecture.md