azd init does not verify installed extension satisfies configured version constraint
- 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#pullrequestreview-4158178164)) 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` processes the `requiredVersions.extensions` map in `azure.yaml`, it checks whether each extension is already installed. If an extension is installed at **any version**, `azd init` skips it — it does not verify that the installed version satisfies the configured version constraint.
For example, if `azure.yaml` specifies `>=2.0.0` but version `1.0.0` is installed, `azd init` silently moves on without upgrading or warning the user.
## Scope
Update `initializeExtensions` in `cmd/init.go` to check whether the installed extension version satisfies the constraint declared in `azure.yaml`. If it does not, either:
- Upgrade the extension to a version that satisfies the constraint, or
- Warn the user that the installed version does not match
## Acceptance Criteria
- [ ] `azd init` checks the installed extension version against the `azure.yaml` constraint
- [ ] If the installed version does not satisfy the constraint, the user is informed (warning or automatic upgrade)
- [ ] Unit tests cover the version mismatch scenario
Contributor guide
Assessment
This issue has not been assessed yet.