diff --git a/.github/workflows/quest-bulk.yml b/.github/workflows/quest-bulk.yml index acc953e6ca..027fa82366 100644 --- a/.github/workflows/quest-bulk.yml +++ b/.github/workflows/quest-bulk.yml @@ -2,6 +2,7 @@ name: "bulk quest import" on: schedule: - cron: '0 10 * * *' # UTC time, that's 5:00 am EST, 2:00 am PST. + - cron: '0 10 6 * *' # This is the morning of the 6th. workflow_dispatch: inputs: reason: @@ -57,4 +58,4 @@ jobs: org: ${{ github.repository_owner }} repo: ${{ github.repository }} issue: '-1' - duration: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.duration || 5 }} + duration: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.duration || github.event.schedule == '0 10 6 * *' && -1 || 5 }} diff --git a/docs/authentication/keycloak-integration.md b/docs/authentication/keycloak-integration.md index 180c6d6ed8..d12c885cbb 100644 --- a/docs/authentication/keycloak-integration.md +++ b/docs/authentication/keycloak-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire Keycloak integration (Preview) description: Learn how to use the .NET Aspire Keycloak integration, which includes both hosting and client integrations. -ms.date: 12/06/2024 +ms.date: 03/06/2025 uid: authentication/keycloak-integration --- @@ -178,7 +178,7 @@ To get started with the .NET Aspire Keycloak client integration, install the [ ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Aspire.Keycloak.Authentication +dotnet add package Aspire.Keycloak.Authentication --prerelease ``` ### [PackageReference](#tab/package-reference) diff --git a/docs/azureai/azureai-openai-integration.md b/docs/azureai/azureai-openai-integration.md index 0f43bcaa9c..3da2fbb608 100644 --- a/docs/azureai/azureai-openai-integration.md +++ b/docs/azureai/azureai-openai-integration.md @@ -1,33 +1,29 @@ --- title: .NET Aspire Azure OpenAI integration (Preview) description: Learn how to use the .NET Aspire Azure OpenAI integration. -ms.topic: how-to -ms.date: 02/14/2025 +ms.date: 03/06/2025 --- # .NET Aspire Azure OpenAI integration (Preview) -In this article, you learn how to use the .NET Aspire Azure OpenAI client. The `Aspire.Azure.AI.OpenAI` library is used to register an `OpenAIClient` in the dependency injection (DI) container for consuming Azure OpenAI or OpenAI functionality. It enables corresponding logging and telemetry. +[!INCLUDE [includes-hosting-and-client](../includes/includes-hosting-and-client.md)] -For more information on using the `OpenAIClient`, see [Quickstart: Get started generating text using Azure OpenAI Service](/azure/ai-services/openai/quickstart?tabs=command-line%2Cpython&pivots=programming-language-csharp). +[Azure OpenAI Service](https://azure.microsoft.com/products/ai-services/openai-service) provides access to OpenAI's powerful language and embedding models with the security and enterprise promise of Azure. The .NET Aspire Azure OpenAI integration enables you to connect to Azure OpenAI Service or OpenAI's API from your .NET applications. -## Get started +## Hosting integration -- Azure subscription: [create one for free](https://azure.microsoft.com/free/). -- Azure OpenAI or OpenAI account: [create an Azure OpenAI Service resource](/azure/ai-services/openai/how-to/create-resource). - -To get started with the .NET Aspire Azure OpenAI integration, install the [📦 Aspire.Azure.AI.OpenAI](https://www.nuget.org/packages/Aspire.Azure.AI.OpenAI) NuGet package in the client-consuming project, i.e., the project for the application that uses the Azure OpenAI client. +The .NET Aspire [Azure OpenAI](/azure/ai-services/openai/) hosting integration models Azure OpenAI resources as <xref:Aspire.Hosting.ApplicationModel.AzureOpenAIResource>. To access these types and APIs for expressing them within your [app host](xref:dotnet/aspire/app-host) project, install the [📦 Aspire.Hosting.Azure.CognitiveServices](https://www.nuget.org/packages/Aspire.Hosting.Azure.CognitiveServices) NuGet package: ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Aspire.Azure.AI.OpenAI +dotnet add package Aspire.Hosting.Azure.CognitiveServices ``` ### [PackageReference](#tab/package-reference) ```xml -<PackageReference Include="Aspire.Azure.AI.OpenAI" +<PackageReference Include="Aspire.Hosting.Azure.CognitiveServices" Version="*" /> ``` @@ -35,104 +31,357 @@ dotnet add package Aspire.Azure.AI.OpenAI For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies). -## Example usage +### Add an Azure OpenAI resource -In the _:::no-loc text="Program.cs":::_ file of your client-consuming project, call the extension method to register an `OpenAIClient` for use via the dependency injection container. The method takes a connection name parameter. +To add an <xref:Aspire.Hosting.ApplicationModel.AzureOpenAIResource> to your app host project, call the <xref:Aspire.Hosting.AzureOpenAIExtensions.AddAzureOpenAI%2A> method: ```csharp -builder.AddAzureOpenAIClient("openAiConnectionName"); +var builder = DistributedApplication.CreateBuilder(args); + +var openai = builder.AddAzureOpenAI("openai"); + +builder.AddProject<Projects.ExampleProject>() + .WithReference(openai); + +// After adding all resources, run the app... ``` -In the preceding code, the `AddAzureOpenAIClient` method adds an `OpenAIClient` to the DI container. The `openAiConnectionName` parameter is the name of the connection string in the configuration. You can then retrieve the `OpenAIClient` instance using dependency injection. For example, to retrieve the connection from an example service: +The preceding code adds an Azure OpenAI resource named `openai` to the app host project. The <xref:Aspire.Hosting.ResourceBuilderExtensions.WithReference%2A> method passes the connection information to the `ExampleProject` project. + +> [!IMPORTANT] +> When you call <xref:Aspire.Hosting.AzureOpenAIExtensions.AddAzureOpenAI%2A>, it implicitly calls <xref:Aspire.Hosting.AzureProvisionerExtensions.AddAzureProvisioning(Aspire.Hosting.IDistributedApplicationBuilder)>—which adds support for generating Azure resources dynamically during app startup. The app must configure the appropriate subscription and location. For more information, see [Local provisioning: Configuration](../azure/local-provisioning.md#configuration). + +### Add an Azure OpenAI deployment resource + +To add an Azure OpenAI deployment resource, call the <xref:Aspire.Hosting.AzureOpenAIExtensions.AddDeployment(Aspire.Hosting.ApplicationModel.IResourceBuilder{Aspire.Hosting.ApplicationModel.AzureOpenAIResource},Aspire.Hosting.ApplicationModel.AzureOpenAIDeployment)> method: ```csharp -public class ExampleService(OpenAIClient client) +var builder = DistributedApplication.CreateBuilder(args); + +var openai = builder.AddAzureOpenAI("openai"); +openai.AddDeployment( + new AzureOpenAIDeployment( + name: "preview", + modelName: "gpt-4.5-preview", + modelVersion: "2025-02-27")); + +builder.AddProject<Projects.ExampleProject>() + .WithReference(openai) + .WaitFor(openai); + +// After adding all resources, run the app... +``` + +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](/azure/ai-services/openai/concepts/models) in the Azure OpenAI service. + +### Generated provisioning Bicep + +If you're new to [Bicep](/azure/azure-resource-manager/bicep/overview), it's a domain-specific language for defining Azure resources. With .NET Aspire, you don't need to write Bicep by-hand, instead the provisioning APIs generate Bicep for you. When you publish your app, the generated Bicep provisions an Azure OpenAI resource with standard defaults. + +:::code language="bicep" source="../snippets/azure/AppHost/openai.module.bicep"::: + +The preceding Bicep is a module that provisions an Azure Cognitive Services resource with the following defaults: + +- `location`: The location of the resource group. +- `principalType`: The principal type of the Cognitive Services resource. +- `principalId`: The principal ID of the Cognitive Services resource. +- `openai`: The Cognitive Services account resource. + - `kind`: The kind of the resource, set to `OpenAI`. + - `properties`: The properties of the resource. + - `customSubDomainName`: The custom subdomain name for the resource, based on the unique string of the resource group ID. + - `publicNetworkAccess`: Set to `Enabled`. + - `disableLocalAuth`: Set to `true`. + - `sku`: The SKU of the resource, set to `S0`. +- `openai_CognitiveServicesOpenAIContributor`: The Cognitive Services resource owner, based on the build-in `Azure Cognitive Services OpenAI Contributor` role. For more information, see [Azure Cognitive Services OpenAI Contributor](/azure/role-based-access-control/built-in-roles/ai-machine-learning#cognitive-services-openai-contributor). +- `preview`: The deployment resource, based on the `preview` name. + - `properties`: The properties of the deployment resource. + - `format`: The format of the deployment resource, set to `OpenAI`. + - `modelName`: The model name of the deployment resource, set to `gpt-4.5-preview`. + - `modelVersion`: The model version of the deployment resource, set to `2025-02-27`. +- `connectionString`: The connection string, containing the endpoint of the Cognitive Services resource. + +The generated Bicep is a starting point and can be customized to meet your specific requirements. + +### Customize provisioning infrastructure + +All .NET Aspire Azure resources are subclasses of the <xref:Aspire.Hosting.Azure.AzureProvisioningResource> type. This enables customization of the generated Bicep by providing a fluent API to configure the Azure resources—using the <xref:Aspire.Hosting.AzureProvisioningResourceExtensions.ConfigureInfrastructure``1(Aspire.Hosting.ApplicationModel.IResourceBuilder{``0},System.Action{Aspire.Hosting.Azure.AzureResourceInfrastructure})> API: + +:::code language="csharp" source="../snippets/azure/AppHost/Program.ConfigureOpenAIInfra.cs" id="configure"::: + +The preceding code: + +- Chains a call to the <xref:Aspire.Hosting.AzureProvisioningResourceExtensions.ConfigureInfrastructure*> API: + - The `infra` parameter is an instance of the <xref:Aspire.Hosting.Azure.AzureResourceInfrastructure> type. + - The provisionable resources are retrieved by calling the <xref:Azure.Provisioning.Infrastructure.GetProvisionableResources> method. + - The single <xref:Azure.Provisioning.CognitiveServices.CognitiveServicesAccount> resource is retrieved. + - The <xref:Azure.Provisioning.CognitiveServices.CognitiveServicesAccount.Sku?displayProperty=nameWithType> property is assigned to a new instance of <xref:Azure.Provisioning.CognitiveServices.CognitiveServicesSku> with an `E0` name and <xref:Azure.Provisioning.CognitiveServices.CognitiveServicesSkuTier.Enterprise?displayProperty=nameWithType> tier. + - A tag is added to the Cognitive Services resource with a key of `ExampleKey` and a value of `Example value`. + +### Connect to an existing Azure OpenAI service + +You might have an existing Azure OpenAI service that you want to connect to. You can chain a call to annotate that your <xref:Aspire.Hosting.ApplicationModel.AzureOpenAIResource> is an existing resource: + +```csharp +var builder = DistributedApplication.CreateBuilder(args); + +var existingOpenAIName = builder.AddParameter("existingOpenAIName"); +var existingOpenAIResourceGroup = builder.AddParameter("existingOpenAIResourceGroup"); + +var openai = builder.AddAzureOpenAI("openai") + .AsExisting(existingOpenAIName, existingOpenAIResourceGroup); + +builder.AddProject<Projects.ExampleProject>() + .WithReference(openai); + +// After adding all resources, run the app... +``` + +For more information on treating Azure OpenAI resources as existing resources, see [Use existing Azure resources](../azure/integrations-overview.md#use-existing-azure-resources). + +Alternatively, instead of representing an Azure OpenAI resource, you can add a connection string to the app host. Which is a weakly-typed approach that's based solely on a `string` value. To add a connection to an existing Azure OpenAI service, call the <xref:Aspire.Hosting.ParameterResourceBuilderExtensions.AddConnectionString%2A> method: + +```csharp +var builder = DistributedApplication.CreateBuilder(args); + +var openai = builder.ExecutionContext.IsPublishMode + ? builder.AddAzureOpenAI("openai") + : builder.AddConnectionString("openai"); + +builder.AddProject<Projects.ExampleProject>() + .WithReference(openai); + +// After adding all resources, run the app... +``` + +[!INCLUDE [connection-strings-alert](../includes/connection-strings-alert.md)] + +The connection string is configured in the app host's configuration, typically under User Secrets, under the `ConnectionStrings` section: + +```json { - // Use client... + "ConnectionStrings": { + "openai": "https://{account_name}.openai.azure.com/" + } } ``` -## App host usage +For more information, see [Add existing Azure resources with connection strings](../azure/integrations-overview.md#add-existing-azure-resources-with-connection-strings). + +## Client integration -To add Azure hosting support to your <xref:Aspire.Hosting.IDistributedApplicationBuilder>, install the [📦 Aspire.Hosting.Azure.CognitiveServices](https://www.nuget.org/packages/Aspire.Hosting.Azure.CognitiveServices) NuGet package in the [app host](xref:dotnet/aspire/app-host) project. +To get started with the .NET Aspire Azure OpenAI client integration, install the [📦 Aspire.Azure.AI.OpenAI](https://www.nuget.org/packages/Aspire.Azure.AI.OpenAI) NuGet package in the client-consuming project, that is, the project for the application that uses the Azure OpenAI client. ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Aspire.Hosting.Azure.CognitiveServices +dotnet add package Aspire.Azure.AI.OpenAI ``` ### [PackageReference](#tab/package-reference) ```xml -<PackageReference Include="Aspire.Hosting.Azure.CognitiveServices" +<PackageReference Include="Aspire.Azure.AI.OpenAI" Version="*" /> ``` --- -In your app host project, register an Azure OpenAI resource using the following methods, such as <xref:Aspire.Hosting.AzureOpenAIExtensions.AddAzureOpenAI%2A>: +### Add an Azure OpenAI client + +In the _Program.cs_ file of your client-consuming project, use the <xref:Microsoft.Extensions.Hosting.AspireAzureOpenAIExtensions.AddAzureOpenAIClient(Microsoft.Extensions.Hosting.IHostApplicationBuilder,System.String,System.Action{Aspire.Azure.AI.OpenAI.AzureOpenAISettings},System.Action{Azure.Core.Extensions.IAzureClientBuilder{Azure.AI.OpenAI.AzureOpenAIClient,Azure.AI.OpenAI.AzureOpenAIClientOptions}})> method on any <xref:Microsoft.Extensions.Hosting.IHostApplicationBuilder> to register an `OpenAIClient` for dependency injection (DI). The `AzureOpenAIClient` is a subclass of `OpenAIClient`, allowing you to request either type from DI. This ensures code not dependent on Azure-specific features remains generic. The `AddAzureOpenAIClient` method requires a connection name parameter. ```csharp -var builder = DistributedApplication.CreateBuilder(args); +builder.AddAzureOpenAIClient(connectionName: "openai"); +``` -var openai = builder.ExecutionContext.IsPublishMode - ? builder.AddAzureOpenAI("openAiConnectionName") - : builder.AddConnectionString("openAiConnectionName"); +> [!TIP] +> The `connectionName` parameter must match the name used when adding the Azure OpenAI resource in the app host project. For more information, see [Add an Azure OpenAI resource](#add-an-azure-openai-resource). -builder.AddProject<Projects.ExampleProject>() - .WithReference(openai); +After adding the `OpenAIClient`, you can retrieve the client instance using dependency injection: + +```csharp +public class ExampleService(OpenAIClient client) +{ + // Use client... +} +``` + +For more information, see: + +- [Azure.AI.OpenAI documentation](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/README.md) for examples on using the `OpenAIClient`. +- [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection) for details on dependency injection. +- [Quickstart: Get started using GPT-35-Turbo and GPT-4 with Azure OpenAI Service](/azure/ai-services/openai/chatgpt-quickstart?pivots=programming-language-csharp). + +### Add Azure OpenAI client with registered `IChatClient` + +If you're interested in using the <xref:Microsoft.Extensions.AI.IChatClient> interface, with the OpenAI client, simply chain either of the following APIs to the `AddAzureOpenAIClient` method: + +- <xref:Microsoft.Extensions.Hosting.AspireOpenAIClientBuilderChatClientExtensions.AddChatClient(Aspire.OpenAI.AspireOpenAIClientBuilder,System.String)>: Registers a singleton `IChatClient` in the services provided by the <xref:Aspire.OpenAI.AspireOpenAIClientBuilder>. +- <xref:Microsoft.Extensions.Hosting.AspireOpenAIClientBuilderChatClientExtensions.AddKeyedChatClient(Aspire.OpenAI.AspireOpenAIClientBuilder,System.String,System.String)>: Registers a keyed singleton `IChatClient` in the services provided by the <xref:Aspire.OpenAI.AspireOpenAIClientBuilder>. + +For example, consider the following C# code that adds an `IChatClient` to the DI container: + +```csharp +builder.AddAzureOpenAIClient(connectionName: "openai") + .AddChatClient("deploymentName"); +``` + +Similarly, you can add a keyed `IChatClient` with the following C# code: + +```csharp +builder.AddAzureOpenAIClient(connectionName: "openai") + .AddKeyedChatClient("serviceKey", "deploymentName"); +``` + +For more information on the `IChatClient` and its corresponding library, see [Artificial intelligence in .NET (Preview)](/dotnet/core/extensions/artificial-intelligence). + +### Configure Azure OpenAI client settings + +The .NET Aspire Azure OpenAI library provides a set of settings to configure the Azure OpenAI client. The `AddAzureOpenAIClient` method exposes an optional `configureSettings` parameter of type `Action<AzureOpenAISettings>?`. To configure settings inline, consider the following example: + +```csharp +builder.AddAzureOpenAIClient( + connectionName: "openai", + configureSettings: settings => + { + settings.DisableTracing = true; + + var uriString = builder.Configuration["AZURE_OPENAI_ENDPOINT"] + ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); + + settings.Endpoint = new Uri(uriString); + }); +``` + +The preceding code sets the <xref:Aspire.Azure.AI.OpenAI.AzureOpenAISettings.DisableTracing?displayProperty=nameWithType> property to `true`, and sets the <xref:Aspire.Azure.AI.OpenAI.AzureOpenAISettings.Endpoint?displayProperty=nameWithType> property to the Azure OpenAI endpoint. + +### Configure Azure OpenAI client builder options + +To configure the <xref:Azure.AI.OpenAI.AzureOpenAIClientOptions> for the client, you can use the <xref:Microsoft.Extensions.Hosting.AspireAzureOpenAIExtensions.AddAzureOpenAIClient%2A> method. This method takes an optional `configureClientBuilder` parameter of type `Action<IAzureClientBuilder<OpenAIClient, AzureOpenAIClientOptions>>?`. Consider the following example: + +```csharp +builder.AddAzureOpenAIClient( + connectionName: "openai", + configureClientBuilder: clientBuilder => + { + clientBuilder.ConfigureOptions(options => + { + options.UserAgentApplicationId = "CLIENT_ID"; + }); + }); ``` -The `AddAzureAIOpenAI` method will read connection information from the app host's configuration (for example, from "user secrets") under the `ConnectionStrings:openAiConnectionName` config key. The <xref:Aspire.Hosting.ResourceBuilderExtensions.WithReference%2A> method passes that connection information into a connection string named `openAiConnectionName` in the `ExampleProject` project. In the _:::no-loc text="Program.cs":::_ file of ExampleProject, the connection can be consumed using: +The client builder is an instance of the <xref:Azure.Core.Extensions.IAzureClientBuilder`2> type, which provides a fluent API to configure the client options. The preceding code sets the <xref:Azure.AI.OpenAI.AzureOpenAIClientOptions.UserAgentApplicationId?displayProperty=nameWithType> property to `CLIENT_ID`. For more information, see <xref:Microsoft.Extensions.AI.ConfigureOptionsChatClientBuilderExtensions.ConfigureOptions(Microsoft.Extensions.AI.ChatClientBuilder,System.Action{Microsoft.Extensions.AI.ChatOptions})>. + +### Add Azure OpenAI client from configuration + +Additionally, the package provides the <xref:Microsoft.Extensions.Hosting.AspireConfigurableOpenAIExtensions.AddOpenAIClientFromConfiguration(Microsoft.Extensions.Hosting.IHostApplicationBuilder,System.String)> extension method to register an `OpenAIClient` or `AzureOpenAIClient` instance based on the provided connection string. This method follows these rules: + +- If the `Endpoint` attribute is empty or missing, an `OpenAIClient` instance is registered using the provided key, for example, `Key={key};`. +- If the `IsAzure` attribute is `true`, an `AzureOpenAIClient` is registered; otherwise, an `OpenAIClient` is registered, for example, `Endpoint={azure_endpoint};Key={key};IsAzure=true` registers an `AzureOpenAIClient`, while `Endpoint=https://localhost:18889;Key={key}` registers an `OpenAIClient`. +- If the `Endpoint` attribute contains `".azure."`, an `AzureOpenAIClient` is registered; otherwise, an `OpenAIClient` is registered, for example, `Endpoint=https://{account}.azure.com;Key={key};`. + +Consider the following example: ```csharp -builder.AddAzureAIOpenAI("openAiConnectionName"); +builder.AddOpenAIClientFromConfiguration("openai"); ``` -## Configuration +> [!TIP] +> A valid connection string must contain at least an `Endpoint` or a `Key`. + +Consider the following example connection strings and whether they register an `OpenAIClient` or `AzureOpenAIClient`: -The .NET Aspire Azure OpenAI integration provides multiple options to configure the connection based on the requirements and conventions of your project. +| Example connection string | Registered client type | +|--|--| +| `Endpoint=https://{account_name}.openai.azure.com/;Key={account_key}` | `AzureOpenAIClient` | +| `Endpoint=https://{account_name}.openai.azure.com/;Key={account_key};IsAzure=false` | `OpenAIClient` | +| `Endpoint=https://{account_name}.openai.azure.com/;Key={account_key};IsAzure=true` | `AzureOpenAIClient` | +| `Endpoint=https://localhost:18889;Key={account_key}` | `OpenAIClient` | -### Use a connection string +### Add keyed Azure OpenAI clients -When using a connection string from the `ConnectionStrings` configuration section, you can provide the name of the connection string when calling `builder.AddAzureAIOpenAI`: +There might be situations where you want to register multiple `OpenAIClient` instances with different connection names. To register keyed Azure OpenAI clients, call the <xref:Microsoft.Extensions.Hosting.AspireAzureOpenAIExtensions.AddKeyedAzureOpenAIClient*> method: ```csharp -builder.AddAzureAIOpenAI("openAiConnectionName"); +builder.AddKeyedAzureOpenAIClient(name: "chat"); +builder.AddKeyedAzureOpenAIClient(name: "code"); ``` -The connection string is retrieved from the `ConnectionStrings` configuration section, and there are two supported formats, either the account endpoint used in conjunction with the default Azure credential or a connection string with the account key. +> [!IMPORTANT] +> When using keyed services, ensure that your Azure OpenAI resource configures two named connections, one for `chat` and one for `code`. + +Then you can retrieve the client instances using dependency injection. For example, to retrieve the clients from a service: + +```csharp +public class ExampleService( + [KeyedService("chat")] OpenAIClient chatClient, + [KeyedService("code")] OpenAIClient codeClient) +{ + // Use clients... +} +``` + +For more information, see [Keyed services in .NET](/dotnet/core/extensions/dependency-injection#keyed-services). + +### Add keyed Azure OpenAI clients from configuration + +The same functionality and rules exist for keyed Azure OpenAI clients as for the nonkeyed clients. You can use the <xref:Microsoft.Extensions.Hosting.AspireConfigurableOpenAIExtensions.AddKeyedOpenAIClientFromConfiguration(Microsoft.Extensions.Hosting.IHostApplicationBuilder,System.String)> extension method to register an `OpenAIClient` or `AzureOpenAIClient` instance based on the provided connection string. -#### Account endpoint +Consider the following example: + +```csharp +builder.AddKeyedOpenAIClientFromConfiguration("openai"); +``` + +This method follows the same rules as detailed in the [Add Azure OpenAI client from configuration](#add-azure-openai-client-from-configuration). + +### Configuration + +The .NET Aspire Azure OpenAI library provides multiple options to configure the Azure OpenAI connection based on the requirements and conventions of your project. Either a `Endpoint` or a `ConnectionString` is required to be supplied. + +#### Use a connection string + +When using a connection string from the `ConnectionStrings` configuration section, you can provide the name of the connection string when calling `builder.AddAzureOpenAIClient`: + +```csharp +builder.AddAzureOpenAIClient("openai"); +``` + +The connection string is retrieved from the `ConnectionStrings` configuration section, and there are two supported formats: + +##### Account endpoint The recommended approach is to use an **Endpoint**, which works with the `AzureOpenAISettings.Credential` property to establish a connection. If no credential is configured, the <xref:Azure.Identity.DefaultAzureCredential> is used. ```json { "ConnectionStrings": { - "openAiConnectionName": "https://{account_name}.openai.azure.com/" + "openai": "https://{account_name}.openai.azure.com/" } } ``` -For more information, see [Use Azure OpenAI without keys](/azure/developer/ai/keyless-connections). +For more information, see [Use Azure OpenAI without keys](/azure/developer/ai/keyless-connections?tabs=csharp%2Cazure-cli). -#### Connection string +##### Connection string -Alternatively, a custom connection string can be used. +Alternatively, a custom connection string can be used: ```json { "ConnectionStrings": { - "openAiConnectionName": "Endpoint=https://{account_name}.openai.azure.com/;Key={account_key};" + "openai": "Endpoint=https://{account_name}.openai.azure.com/;Key={account_key};" } } ``` In order to connect to the non-Azure OpenAI service, drop the `Endpoint` property and only set the Key property to set the [API key](https://platform.openai.com/account/api-keys). -### Use configuration providers +#### Use configuration providers The .NET Aspire Azure OpenAI integration supports <xref:Microsoft.Extensions.Configuration>. It loads the `AzureOpenAISettings` from configuration by using the `Aspire:Azure:AI:OpenAI` key. Example _:::no-loc text="appsettings.json":::_ that configures some of the options: @@ -142,7 +391,7 @@ The .NET Aspire Azure OpenAI integration supports <xref:Microsoft.Extensions.Con "Azure": { "AI": { "OpenAI": { - "DisableTracing": false, + "DisableTracing": false } } } @@ -150,21 +399,23 @@ The .NET Aspire Azure OpenAI integration supports <xref:Microsoft.Extensions.Con } ``` -### Use inline delegates +For the complete Azure OpenAI client integration JSON schema, see [Aspire.Azure.AI.OpenAI/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Azure.AI.OpenAI/ConfigurationSchema.json). -Also you can pass the `Action<AzureOpenAISettings> configureSettings` delegate to set up some or all the options inline, for example to disable tracing from code: +#### Use inline delegates + +You can pass the `Action<AzureOpenAISettings> configureSettings` delegate to set up some or all the options inline, for example to disable tracing from code: ```csharp -builder.AddAzureAIOpenAI( - "openAiConnectionName", +builder.AddAzureOpenAIClient( + "openai", static settings => settings.DisableTracing = true); ``` -You can also setup the OpenAIClientOptions using the optional `Action<IAzureClientBuilder<OpenAIClient, OpenAIClientOptions>> configureClientBuilder` parameter of the `AddAzureAIOpenAI` method. For example, to set the client ID for this client: +You can also set up the OpenAIClientOptions using the optional `Action<IAzureClientBuilder<OpenAIClient, OpenAIClientOptions>> configureClientBuilder` parameter of the `AddAzureOpenAIClient` method. For example, to set the client ID for this client: ```csharp -builder.AddAzureAIOpenAI( - "openAiConnectionName", +builder.AddAzureOpenAIClient( + "openai", configureClientBuilder: builder => builder.ConfigureOptions( options => options.Diagnostics.ApplicationId = "CLIENT_ID")); ``` @@ -179,8 +430,16 @@ The .NET Aspire Azure OpenAI integration uses the following log categories: - `Azure.Core` - `Azure.Identity` +### Tracing + +The .NET Aspire Azure OpenAI integration emits tracing activities using OpenTelemetry for operations performed with the `OpenAIClient`. + +> [!IMPORTANT] +> Tracing is currently experimental with this integration. To opt-in to it, set either the `OPENAI_EXPERIMENTAL_ENABLE_OPEN_TELEMETRY` environment variable to `true` or `1`, or call `AppContext.SetSwitch("OpenAI.Experimental.EnableOpenTelemetry", true))` during app startup. + ## See also -- [Azure OpenAI docs](/azure/ai-services/openai/overview) -- [.NET Aspire integrations](../fundamentals/integrations-overview.md) +- [Azure OpenAI](https://azure.microsoft.com/products/ai-services/openai-service/) +- [.NET Aspire integrations overview](../fundamentals/integrations-overview.md) +- [.NET Aspire Azure integrations overview](../azure/integrations-overview.md) - [.NET Aspire GitHub repo](https://github.com/dotnet/aspire) diff --git a/docs/caching/includes/redis-client-json-settings.md b/docs/caching/includes/redis-client-json-settings.md index 579f54bb17..dc60d2796b 100644 --- a/docs/caching/includes/redis-client-json-settings.md +++ b/docs/caching/includes/redis-client-json-settings.md @@ -21,4 +21,4 @@ The .NET Aspire Stack Exchange Redis integration supports <xref:Microsoft.Extens } ``` -For the complete Redis client integration JSON schema, see [Aspire.StackExchange.Redis/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.StackExchange.Redis/ConfigurationSchema.json). +For the complete Redis client integration JSON schema, see [Aspire.StackExchange.Redis/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.StackExchange.Redis/ConfigurationSchema.json). diff --git a/docs/caching/includes/redis-distributed-client-json-settings.md b/docs/caching/includes/redis-distributed-client-json-settings.md index a58f65609c..91abef30d4 100644 --- a/docs/caching/includes/redis-distributed-client-json-settings.md +++ b/docs/caching/includes/redis-distributed-client-json-settings.md @@ -21,4 +21,4 @@ The .NET Aspire Stack Exchange Redis distributed caching integration supports <x } ``` -For the complete Redis distributed caching client integration JSON schema, see [Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json). +For the complete Redis distributed caching client integration JSON schema, see [Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json). diff --git a/docs/caching/includes/redis-output-client-json-settings.md b/docs/caching/includes/redis-output-client-json-settings.md index af2ec24492..83f90405f4 100644 --- a/docs/caching/includes/redis-output-client-json-settings.md +++ b/docs/caching/includes/redis-output-client-json-settings.md @@ -21,4 +21,4 @@ The .NET Aspire Stack Exchange Redis output caching integration supports <xref:M } ``` -For the complete Redis output caching client integration JSON schema, see [Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json). +For the complete Redis output caching client integration JSON schema, see [Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json). diff --git a/docs/database/azure-cosmos-db-entity-framework-integration.md b/docs/database/azure-cosmos-db-entity-framework-integration.md index 650999c743..d6b18de7b7 100644 --- a/docs/database/azure-cosmos-db-entity-framework-integration.md +++ b/docs/database/azure-cosmos-db-entity-framework-integration.md @@ -104,7 +104,7 @@ The .NET Aspire Microsoft Entity Framework Core Cosmos DB integration supports < } ``` -For the complete Cosmos DB client integration JSON schema, see [Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json). +For the complete Cosmos DB client integration JSON schema, see [Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/database/azure-cosmos-db-integration.md b/docs/database/azure-cosmos-db-integration.md index 3b0a57f5e2..db311bbdbf 100644 --- a/docs/database/azure-cosmos-db-integration.md +++ b/docs/database/azure-cosmos-db-integration.md @@ -129,7 +129,7 @@ The .NET Aspire Azure Cosmos DB integration supports <xref:Microsoft.Extensions. } ``` -For the complete Cosmos DB client integration JSON schema, see [Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json). +For the complete Cosmos DB client integration JSON schema, see [Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/database/includes/postgresql-client.md b/docs/database/includes/postgresql-client.md index 878314a75b..d7ca9e2cd5 100644 --- a/docs/database/includes/postgresql-client.md +++ b/docs/database/includes/postgresql-client.md @@ -105,7 +105,7 @@ The following example shows an _:::no-loc text="appsettings.json":::_ file that } ``` -For the complete PostgreSQL client integration JSON schema, see [Aspire.Npgsql/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Npgsql/ConfigurationSchema.json). +For the complete PostgreSQL client integration JSON schema, see [Aspire.Npgsql/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Npgsql/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/database/includes/postgresql-ef-client.md b/docs/database/includes/postgresql-ef-client.md index 8e0aae585a..7733931d69 100644 --- a/docs/database/includes/postgresql-ef-client.md +++ b/docs/database/includes/postgresql-ef-client.md @@ -121,7 +121,7 @@ The following example shows an _:::no-loc text="appsettings.json":::_ file that } ``` -For the complete PostgreSQL Entity Framework Core client integration JSON schema, see [Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json). +For the complete PostgreSQL Entity Framework Core client integration JSON schema, see [Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/database/milvus-integration.md b/docs/database/milvus-integration.md index 9d90650775..8dc586b79c 100644 --- a/docs/database/milvus-integration.md +++ b/docs/database/milvus-integration.md @@ -270,7 +270,7 @@ The .NET Aspire Milvus client integration supports <xref:Microsoft.Extensions.Co } ``` -For the complete Milvus client integration JSON schema, see [Aspire.Milvus.Client/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Milvus.Client/ConfigurationSchema.json). +For the complete Milvus client integration JSON schema, see [Aspire.Milvus.Client/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Milvus.Client/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/database/qdrant-integration.md b/docs/database/qdrant-integration.md index 27be5c0e1f..5a7c997f99 100644 --- a/docs/database/qdrant-integration.md +++ b/docs/database/qdrant-integration.md @@ -243,7 +243,7 @@ The .NET Aspire Qdrant client integration supports <xref:Microsoft.Extensions.Co } ``` -For the complete Qdrant client integration JSON schema, see [Aspire.Qdrant.Client/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Qdrant.Client/ConfigurationSchema.json). +For the complete Qdrant client integration JSON schema, see [Aspire.Qdrant.Client/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Qdrant.Client/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/logging/seq-integration.md b/docs/logging/seq-integration.md index b412d8a399..9f74ec7cfc 100644 --- a/docs/logging/seq-integration.md +++ b/docs/logging/seq-integration.md @@ -166,7 +166,7 @@ The .NET Aspire Seq integration supports <xref:Microsoft.Extensions.Configuratio } ``` -For the complete Seq client integration JSON schema, see [Aspire.Seq/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Microsoft.Data.SqlClient/ConfigurationSchema.json). +For the complete Seq client integration JSON schema, see [Aspire.Seq/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Microsoft.Data.SqlClient/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/messaging/azure-service-bus-integration.md b/docs/messaging/azure-service-bus-integration.md index 4d99d757cd..ae5c632112 100644 --- a/docs/messaging/azure-service-bus-integration.md +++ b/docs/messaging/azure-service-bus-integration.md @@ -386,7 +386,7 @@ The .NET Aspire Azure Service Bus integration supports <xref:Microsoft.Extension } ``` -For the complete Service Bus client integration JSON schema, see [Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json). +For the complete Service Bus client integration JSON schema, see [Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/messaging/kafka-integration.md b/docs/messaging/kafka-integration.md index ee7ef940c7..e55450e486 100644 --- a/docs/messaging/kafka-integration.md +++ b/docs/messaging/kafka-integration.md @@ -249,7 +249,7 @@ The `Config` properties of both `Aspire:Confluent:Kafka:Producer` and `Aspire.C `Confluent.Kafka.Consumer<TKey, TValue>` requires the `ClientId` property to be set to let the broker track consumed message offsets. -For the complete Kafka client integration JSON schema, see [Aspire.Confluent.Kafka/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Confluent.Kafka/ConfigurationSchema.json). +For the complete Kafka client integration JSON schema, see [Aspire.Confluent.Kafka/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Confluent.Kafka/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/messaging/nats-integration.md b/docs/messaging/nats-integration.md index a679704d56..2f47b46782 100644 --- a/docs/messaging/nats-integration.md +++ b/docs/messaging/nats-integration.md @@ -247,7 +247,7 @@ The .NET Aspire NATS integration supports <xref:Microsoft.Extensions.Configurati } ``` -For the complete NATS client integration JSON schema, see [Aspire.NATS.Net/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.NATS.Net/ConfigurationSchema.json). +For the complete NATS client integration JSON schema, see [Aspire.NATS.Net/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.NATS.Net/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/messaging/rabbitmq-integration.md b/docs/messaging/rabbitmq-integration.md index e32c282d34..15ece97649 100644 --- a/docs/messaging/rabbitmq-integration.md +++ b/docs/messaging/rabbitmq-integration.md @@ -255,7 +255,7 @@ The .NET Aspire RabbitMQ integration supports <xref:Microsoft.Extensions.Configu } ``` -For the complete RabbitMQ client integration JSON schema, see [Aspire.RabbitMQ.Client/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json). +For the complete RabbitMQ client integration JSON schema, see [Aspire.RabbitMQ.Client/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/search/elasticsearch-integration.md b/docs/search/elasticsearch-integration.md index 24517f6941..2c07cf605c 100644 --- a/docs/search/elasticsearch-integration.md +++ b/docs/search/elasticsearch-integration.md @@ -224,7 +224,7 @@ The .NET Aspire Elasticsearch Client integration supports <xref:Microsoft.Extens } ``` -For the complete Elasticsearch client integration JSON schema, see [Aspire.Elastic.Clients.Elasticsearch/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Elastic.Clients.Elasticsearch/ConfigurationSchema.json). +For the complete Elasticsearch client integration JSON schema, see [Aspire.Elastic.Clients.Elasticsearch/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Elastic.Clients.Elasticsearch/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/security/azure-security-key-vault-integration.md b/docs/security/azure-security-key-vault-integration.md index a3a9b5333c..d18eec8ffa 100644 --- a/docs/security/azure-security-key-vault-integration.md +++ b/docs/security/azure-security-key-vault-integration.md @@ -277,7 +277,7 @@ The .NET Aspire Azure Key Vault integration supports <xref:Microsoft.Extensions. } ``` -For the complete Azure Key Vault client integration JSON schema, see [Aspire.Azure.Security.KeyVault/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json). +For the complete Azure Key Vault client integration JSON schema, see [Aspire.Azure.Security.KeyVault/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json). If you have set up your configurations in the `Aspire:Azure:Security:KeyVault` section of your _:::no-loc text="appsettings.json":::_ file you can just call the method `AddAzureKeyVaultSecrets` without passing any parameters. diff --git a/docs/snippets/azure/AppHost/Program.ConfigureOpenAIInfra.cs b/docs/snippets/azure/AppHost/Program.ConfigureOpenAIInfra.cs new file mode 100644 index 0000000000..2f2d83f00d --- /dev/null +++ b/docs/snippets/azure/AppHost/Program.ConfigureOpenAIInfra.cs @@ -0,0 +1,23 @@ +using Azure.Provisioning.CognitiveServices; + +internal static partial class Program +{ + public static void ConfigureOpenAIInfra(IDistributedApplicationBuilder builder) + { + // <configure> + builder.AddAzureOpenAI("openai") + .ConfigureInfrastructure(infra => + { + var resources = infra.GetProvisionableResources(); + var account = resources.OfType<CognitiveServicesAccount>().Single(); + + account.Sku = new CognitiveServicesSku + { + Tier = CognitiveServicesSkuTier.Enterprise, + Name = "E0" + }; + account.Tags.Add("ExampleKey", "Example value"); + }); + // </configure> + } +} diff --git a/docs/snippets/azure/AppHost/Program.cs b/docs/snippets/azure/AppHost/Program.cs index f24a82417c..e3c7de5b19 100644 --- a/docs/snippets/azure/AppHost/Program.cs +++ b/docs/snippets/azure/AppHost/Program.cs @@ -3,19 +3,39 @@ AddAzureInfrastructure(builder); builder.AddAzureAppConfiguration("config"); + builder.AddAzureApplicationInsights("app-insights"); + builder.AddAzureCosmosDB("cosmos"); -builder.AddAzureEventHubs("event-hubs").AddHub("messages"); + +var eventHubs = builder.AddAzureEventHubs("event-hubs"); +eventHubs.AddHub("messages"); + builder.AddAzureKeyVault("key-vault"); + builder.AddAzureLogAnalyticsWorkspace("log-analytics-workspace"); -builder.AddAzureOpenAI("openai"); + +var openai = builder.AddAzureOpenAI("openai"); +openai.AddDeployment( + new AzureOpenAIDeployment( + name: "preview", + modelName: "gpt-4.5-preview", + modelVersion: "2025-02-27")); + builder.AddAzurePostgresFlexibleServer("postgres-flexible"); + builder.AddAzureRedis("redis"); + builder.AddAzureSearch("search"); + builder.AddAzureServiceBus("service-bus"); + builder.AddAzureSignalR("signalr"); + builder.AddAzureSqlServer("sql"); + builder.AddAzureStorage("storage"); + builder.AddAzureWebPubSub("web-pub-sub"); builder.Build().Run(); diff --git a/docs/snippets/azure/AppHost/openai.module.bicep b/docs/snippets/azure/AppHost/openai.module.bicep index 5c5545f267..cf28dc7cab 100644 --- a/docs/snippets/azure/AppHost/openai.module.bicep +++ b/docs/snippets/azure/AppHost/openai.module.bicep @@ -32,4 +32,20 @@ resource openai_CognitiveServicesOpenAIContributor 'Microsoft.Authorization/role scope: openai } +resource preview 'Microsoft.CognitiveServices/accounts/deployments@2024-10-01' = { + name: 'preview' + properties: { + model: { + format: 'OpenAI' + name: 'gpt-4.5-preview' + version: '2025-02-27' + } + } + sku: { + name: 'Standard' + capacity: 8 + } + parent: openai +} + output connectionString string = 'Endpoint=${openai.properties.endpoint}' \ No newline at end of file diff --git a/docs/storage/azure-storage-blobs-integration.md b/docs/storage/azure-storage-blobs-integration.md index 04650226a2..4c243d782e 100644 --- a/docs/storage/azure-storage-blobs-integration.md +++ b/docs/storage/azure-storage-blobs-integration.md @@ -142,7 +142,7 @@ The .NET Aspire Azure Blob Storage integration supports <xref:Microsoft.Extensio } ``` -For the complete Azure Blob Storage client integration JSON schema, see [Aspire.Azure.Storage.Blobs/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Azure.Storage.Blobs/ConfigurationSchema.json). +For the complete Azure Blob Storage client integration JSON schema, see [Aspire.Azure.Storage.Blobs/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Azure.Storage.Blobs/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/storage/azure-storage-queues-integration.md b/docs/storage/azure-storage-queues-integration.md index 887a990aa1..9ad341173c 100644 --- a/docs/storage/azure-storage-queues-integration.md +++ b/docs/storage/azure-storage-queues-integration.md @@ -139,7 +139,7 @@ The .NET Aspire Azure Queue Storage integration supports <xref:Microsoft.Extensi } ``` -For the complete Azure Storage Queues client integration JSON schema, see [Aspire.Azure.Data.Queues/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Azure.Data.Queues/ConfigurationSchema.json). +For the complete Azure Storage Queues client integration JSON schema, see [Aspire.Azure.Data.Queues/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Azure.Data.Queues/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/storage/azure-storage-tables-integration.md b/docs/storage/azure-storage-tables-integration.md index 9365308b89..4758d6ac7b 100644 --- a/docs/storage/azure-storage-tables-integration.md +++ b/docs/storage/azure-storage-tables-integration.md @@ -103,7 +103,7 @@ The .NET Aspire Azure Table Storage integration supports <xref:Microsoft.Extensi } ``` -For the complete Azure Data Tables client integration JSON schema, see [Aspire.Azure.Data.Tables/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json). +For the complete Azure Data Tables client integration JSON schema, see [Aspire.Azure.Data.Tables/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.1.0/src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json). #### Use inline delegates diff --git a/docs/testing/manage-app-host.md b/docs/testing/manage-app-host.md index d8c8935150..6e604c384b 100644 --- a/docs/testing/manage-app-host.md +++ b/docs/testing/manage-app-host.md @@ -162,7 +162,7 @@ public async Task DisableVolumesFromTest() While the `DistributedApplicationTestingBuilder` class is useful for many scenarios, there might be situations where you want more control over starting the app host, such as executing code before the builder is created or after the app host is built. In these cases, you implement your own version of the <xref:Aspire.Hosting.Testing.DistributedApplicationFactory> class. This is what the `DistributedApplicationTestingBuilder` uses internally. ```csharp -public class TestingAspireAppHost +public class TestingAspireAppHost() : DistributedApplicationFactory(typeof(Projects.AspireApp_AppHost)) { // override methods here @@ -178,7 +178,7 @@ The `DistributionApplicationFactory` class provides several lifecycle methods th For example, we can use the `OnBuilderCreating` method to set configuration, such as the subscription and resource group information for Azure, before the app host is created and any dependent Azure resources are provisioned, resulting in our tests using the correct Azure environment. ```csharp -public class TestingAspireAppHost : DistributedApplicationFactory(typeof(Projects.AspireApp_AppHost)) +public class TestingAspireAppHost() : DistributedApplicationFactory(typeof(Projects.AspireApp_AppHost)) { protected override void OnBuilderCreating(DistributedApplicationOptions applicationOptions, HostApplicationBuilderSettings hostOptions) { diff --git a/docs/toc.yml b/docs/toc.yml index e39a9b843a..b9ac233401 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -159,7 +159,7 @@ items: - name: Azure PostgreSQL displayName: postgres,postgresql,database,flexible server,azure for database href: database/azure-postgresql-integration.md - - name: Azure OpenAI + - name: Azure OpenAI (Preview) displayName: azure ai,openai href: azureai/azureai-openai-integration.md - name: Azure SignalR Service @@ -248,13 +248,8 @@ items: - name: Orleans voting sample href: /samples/dotnet/aspire-samples/orleans-voting-sample-app-on-aspire/ - name: PostgreSQL - items: - - name: PostgreSQL - EF Core - displayName: postgresql,database,ef core - href: database/postgresql-entity-framework-integration.md - - name: PostgreSQL - displayName: postgresql,database - href: database/postgresql-integration.md + displayName: postgresql,database + href: database/postgresql-integration.md - name: Qdrant href: database/qdrant-integration.md - name: RabbitMQ service broker