diff --git a/docs/ai/quickstarts/includes/ai-templates-github-models.md b/docs/ai/quickstarts/includes/ai-templates-github-models.md index 87a1f02d58891..2baf9cf885d35 100644 --- a/docs/ai/quickstarts/includes/ai-templates-github-models.md +++ b/docs/ai/quickstarts/includes/ai-templates-github-models.md @@ -89,25 +89,60 @@ To authenticate to GitHub models from your code, you'll need to [create a GitHub ## Configure the app -The **AI Chat Web App** app is almost ready to go as soon as it's created. However, you need to configure the app to use the personal access token you set up for GitHub Models. By default, the app template searches for this value in the project's local .NET user secrets. You can manage user secrets using either the Visual Studio UI or the .NET CLI. +The **AI Chat Web App** is almost ready to go as soon as it's created. However, you need to configure the app to use the personal access token you set up for GitHub Models. By default, the app template searches for this value in the project's local .NET user secrets. You can manage user secrets using either the Visual Studio UI or the .NET CLI. -# [Visual Studio](#tab/configure-visual-studio) +> [!NOTE] +> If you enabled .NET Aspire for your app, skip to the [.NET Aspire configuration](#net-aspire-configuration) section. + +## [Visual Studio](#tab/configure-visual-studio) -1. In Visual Studio, right-click on your project in the Solution Explorer and select **Manage User Secrets**. This opens a `secrets.json` file where you can store your API keys without them being tracked in source control. +1. Right-click on your project in the Solution Explorer and select **Manage User Secrets**. This opens a `secrets.json` file where you can store your API keys without them being tracked in source control. 2. Add the following key and value: ```json { - "GitHubModels:Token": "" + "GitHubModels:Token": "" } ``` -# [.NET CLI](#tab/configure-dotnet-cli) +## [.NET CLI](#tab/configure-dotnet-cli) -```dotnetcli -dotnet user-secrets set GitHubModels:Token -``` +1. Open a terminal window set to the root of your project. + +1. Run the `dotnet user-secrets set` command to set the user secret: + + ```dotnetcli + dotnet user-secrets set GitHubModels:Token + ``` + +--- + +### .NET Aspire configuration + +To use the **AI Chat Web App** template with .NET Aspire orchestration, add the following configurations: + +#### [Visual Studio](#tab/configure-visual-studio-aspire) + +1. Right-click on your `*.AppHost` project in the Solution Explorer and select **Manage User Secrets**. This opens a `secrets.json` file where you can store your API keys without them being tracked in source control. + +2. Add the following key and value: + + ```json + { + "ConnectionStrings:openai": "Endpoint=https://models.inference.ai.azure.com;Key=" + } + ``` + +#### [.NET CLI](#tab/configure-dotnet-cli-aspire) + +1. Open a terminal window set to the root of your `*.AppHost` project. + +1. Run the `dotnet user-secrets set` command to set the user secret: + + ```dotnetcli + dotnet user-secrets set ConnectionStrings:openai "Endpoint=https://models.inference.ai.azure.com;Key=" + ``` ---