Description
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)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
✅ Done