Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ var builder = DistributedApplication.CreateBuilder(args);
var openai = builder.AddAzureOpenAI("openai");

openai.AddDeployment(
name: "preview",
modelName: "gpt-4.5-preview",
modelVersion: "2025-02-27");
name: "<deployment-name>",
modelName: "<model-name>",
modelVersion: "<model-version>");

builder.AddProject<Projects.ExampleProject>()
.WithReference(openai)
Expand All @@ -56,7 +56,7 @@ builder.AddProject<Projects.ExampleProject>()
builder.Build().Run();
```

The preceding code adds an Azure OpenAI resource named `openai` to the AppHost project, configures a deployment with a specific model, and passes the connection information to the `ExampleProject` project.
The preceding code adds an Azure OpenAI resource named `openai` to the AppHost project, configures a deployment with a specific model, and passes the connection information to the `ExampleProject` project. Replace the `<deployment-name>`, `<model-name>`, and `<model-version>` placeholders with values from the [Azure OpenAI available models](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) documentation.

<Aside type="caution">
When you call `AddAzureOpenAI`, it implicitly calls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ var builder = DistributedApplication.CreateBuilder(args);
var openai = builder.AddAzureOpenAI("openai");

openai.AddDeployment(
name: "preview",
modelName: "gpt-4.5-preview",
modelVersion: "2025-02-27");
name: "<deployment-name>",
modelName: "<model-name>",
modelVersion: "<model-version>");

builder.AddProject<Projects.ExampleProject>()
.WithReference(openai)
Expand All @@ -72,7 +72,7 @@ builder.AddProject<Projects.ExampleProject>()
The preceding code:

- Adds an Azure OpenAI resource named `openai`.
- Adds an Azure OpenAI deployment resource named `preview` with a model name of `gpt-4.5-preview`. The model name must correspond to an [available model](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) in the Azure OpenAI service.
- Adds an Azure OpenAI deployment resource. Replace the `<deployment-name>`, `<model-name>`, and `<model-version>` placeholders with values from the [Azure OpenAI available models](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) documentation.

## Connect to an existing Azure OpenAI service

Expand Down Expand Up @@ -124,12 +124,12 @@ resource openai 'Microsoft.CognitiveServices/accounts@2024-10-01' = {
}

resource preview 'Microsoft.CognitiveServices/accounts/deployments@2024-10-01' = {
name: 'preview'
name: '<deployment-name>'
properties: {
model: {
format: 'OpenAI'
name: 'gpt-4.5-preview'
version: '2025-02-27'
name: '<model-name>'
version: '<model-version>'
}
}
sku: {
Expand Down