azd init does not apply requiredAzdVersion compatibility filtering for extensions
- Dominant language
- Go
- Stars
- 569
- Forks
- 364
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 136
Description
## Origin
Identified during review of PR #7836 ([comment](https://github.com/Azure/azure-dev/pull/7836#discussion_r3120128370)) and documented as a known limitation in [extension-resolution-and-versioning.md](https://github.com/Azure/azure-dev/blob/docs/extension-resolution-versioning/cli/azd/docs/extensions/extension-resolution-and-versioning.md).
## Context
When `azd init` installs extensions declared in `azure.yaml`, it calls `Install()` directly without going through `resolveCompatibleExtension()`. This means `requiredAzdVersion` checks are not applied, and an extension version that is incompatible with the running `azd` version may be installed.
By contrast, `azd extension install` does apply `requiredAzdVersion` filtering, warning the user if a newer incompatible version exists and selecting the latest compatible version.
## Scope
Update the `initializeExtensions` path in `cmd/init.go` to call `resolveCompatibleExtension()` (or equivalent logic) so that `requiredAzdVersion` filtering is applied during `azd init`.
## Acceptance Criteria
- [ ] `azd init` applies `requiredAzdVersion` compatibility filtering when installing extensions
- [ ] If no compatible version exists, the user receives a clear error with guidance to upgrade `azd`
- [ ] If a newer incompatible version exists, a warning is shown (consistent with `azd extension install`)
- [ ] Unit tests cover the compatibility filtering scenario during init
Contributor guide
Assessment
This issue has not been assessed yet.