Extension framework - filter out deprecated AI models and add version-level lifecycle status#7536
Conversation
…eprecated versions by default
There was a problem hiding this comment.
Pull request overview
This PR updates the AI model catalog in the azd extension framework to represent lifecycle status at the model-version level (matching ARM’s per-(name,version) entries), and filters out deprecated versions/SKUs during aggregation to avoid offering retired deployment options.
Changes:
- Add
LifecycleStatustoAiModelVersion(proto + Go types + mappers) and deprecateAiModel.lifecycle_status. - Apply
filter.statusesto version lifecycle status before aggregation, so returnedversionsandlocationsreflect only matching versions. - Filter out deprecated model versions (status
Deprecatedor inference deprecation reached) and deprecated SKUs (SKU deprecation date reached) during aggregation; add unit tests covering these behaviors.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/grpc/proto/ai_model.proto | Adds version-level lifecycle status; deprecates model-level status; updates filter semantics docs |
| cli/azd/pkg/azdext/ai_model.pb.go | Regenerated proto bindings for new fields/annotations |
| cli/azd/pkg/azdext/models.pb.go | Regenerated proto bindings (header/version metadata update) |
| cli/azd/pkg/ai/types.go | Domain types updated: version-level status + deprecate model-level status |
| cli/azd/pkg/ai/model_service.go | Aggregation updated to carry per-version status, filter deprecated versions/SKUs, and apply status filtering pre-aggregation |
| cli/azd/pkg/ai/model_service_test.go | Adds tests for pre-aggregation status filtering and deprecation filtering |
| cli/azd/pkg/ai/mapper_registry.go | Maps version lifecycle status between domain and proto types |
| cli/azd/extensions/microsoft.azd.demo/internal/cmd/ai.go | Updates demo output to show lifecycle status per version instead of model-level |
| cli/azd/docs/extensions/extension-framework.md | Documents new filter semantics and lifecycle status behavior |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
…ifecycle docs - Sync environment-variables.md to comprehensive upstream reference (PR Azure#7530): adds Core Azure Variables, Dev Center Variables, App Service Slot Deployments, Extension/Alpha/Auth/Tool/CI/CD/Debug/Test variable sections - Document breaking change from PR Azure#7536: AiModel.lifecycle_status is now deprecated (always empty); callers should use AiModelVersion.lifecycle_status - Document that AiModelFilterOptions.statuses now filters on version-level lifecycle status before aggregation - Document that deprecated model versions and SKUs are automatically excluded Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolves #7534
This PR adds
LifecycleStatustoAiModelVersionso each model version carries its own lifecycle status (e.g.GenerallyAvailable,Deprecating,Preview). The existing model-levelAiModel.LifecycleStatusis deprecated and always empty — callers should use version-level status instead.This also changes the behavior of
AiModelFilterOptions.statuses: it now filters by version lifecycle status before aggregation, so returned versions, locations, and model metadata reflect only the matching versions.Additionally, deprecated model versions (lifecycle status
Deprecatedor past inference deprecation date) and deprecated SKUs (past SKU deprecation date) are now filtered out during model catalog aggregation.Why?
The ARM API returns lifecycle status per model entry (one entry per model name + version). When the same model name has versions with different statuses (e.g.
gpt-4ohas bothDeprecatingandGenerallyAvailableversions), a single model-level status field can't faithfully represent the model. Moving status to the version level eliminates this ambiguity.Filtering deprecated versions and SKUs during aggregation prevents stale entries from appearing in model selection prompts and deployment resolution.
Breaking changes
AiModel.lifecycle_statusis now always empty. Callers reading this field should migrate toAiModelVersion.lifecycle_status. No first-party extensions currently use this field.AiModelFilterOptions.statusesnow filters on version lifecycle status before aggregation, not on the (now-empty) model-level field. This is wire-compatible but semantically different.Testing
azd ai agent initnow omits Standard SKU for gpt-4o-mini, which has been retired: