Azure / Azure/azure-dev

azd init does not verify installed extension satisfies configured version constraint

Open
#7,886 0 comments 0 reactions 0 assignees View on GitHub
area/extensions engineering item
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.