Skip to content

[Breaking change]: Obsoletion of AzureOpenAIDeployment #3059

Closed
@eerhardt

Description

@eerhardt

Description

The Azure OpenAI Hosting integration changed the way it models the deployment (model) objects. Instead of being a simple object, each deployment is now an Aspire child Resource, similar to other child resources like Databases, and Azure ServiceBus Queues.

Version

.NET Aspire 9.2

Previous behavior

var openAI = builder.AddAzureOpenAI(openAIName);

openAI
    .AddDeployment(new AzureOpenAIDeployment("chat", "gpt-4o-mini", "2024-07-18"))
    .AddDeployment(new AzureOpenAIDeployment("embedding", "text-embedding-3-small", "1")); 

New behavior

var openAI = builder.AddAzureOpenAI(openAIName);

var chatModel = openAI.AddDeployment("chat", "gpt-4o-mini", "2024-07-18");
var embeddingModel = openAI.AddDeployment("embedding", "text-embedding-3-small", "1");

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

Reason for change

Modeling the Deployment as an Aspire resource allows it to be referenced by other resources via .WithReference, and the deployment name will flow in the connection configuration. This allows for your .NET apps to not have to hard code a model name, but get it via configuration. This follows how other hosting integrations are designed.

Recommended action

Instead of calling the obsolete APIs, use the new overloads to create a deployment model.

Affected APIs

  • Aspire.Hosting.AzureOpenAIExtensions.AddDeployment(this IResourceBuilder builder, AzureOpenAIDeployment deployment)

Associated WorkItem - 421562

Metadata

Metadata

Assignees

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.Pri1High priority, do before Pri2 and Pri3doc-ideaIndicates issues that are suggestions for new topics [org][type][category]⛓️‍💥 breaking-changeIssues or PRs tracking breaking changes.

Type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions