Skip to content

Small changes to AI template quickstart #47666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 31, 2025
Merged
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
2 changes: 1 addition & 1 deletion docs/ai/quickstarts/ai-templates.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Quickstart - Create a .NET AI app using the AI app template
description: Create a .NET AI app to chat with custom data using the AI app template extensions and the Microsoft.Extensions.AI libraries
ms.date: 2/21/2025
ms.date: 07/30/2025
ms.topic: quickstart
ms.custom: devx-track-dotnet, devx-track-dotnet-ai
author: alexwolfmsft
Expand Down
22 changes: 11 additions & 11 deletions docs/ai/quickstarts/includes/ai-templates-azure-openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ ms.author: alexwolf

## Prerequisites

* .NET 9.0 SDK - [Install the .NET 9.0 SDK](https://dotnet.microsoft.com/download)
* Visual Studio 2022 - [Install Visual Studio 2022](https://visualstudio.microsoft.com/) (optional), or
* Visual Studio Code - [Install Visual Studio Code](https://code.visualstudio.com) (optional)
* With the C# DevKit - [Install C# Dev Kit extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
* [.NET 9.0 SDK](https://dotnet.microsoft.com/download)
* One of the following IDEs (optional):
* [Visual Studio 2022](https://visualstudio.microsoft.com/)
* [Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)

## Install the .NET AI app template

Expand All @@ -31,10 +31,10 @@ After you install the AI app templates, you can use them to create starter apps
1. On the **Create a new project** screen, search for **AI Chat Web App**. Select the matching result and then choose **Next**.
1. On the **Configure your new project** screen, enter the desired name and ___location for your project and then choose **Next**.
1. On the **Additional information** screen:
- For the **Framework** option, select **.NET 9.0**.
- For the **AI service provider** option, select **Azure OpenAI**.
- Make sure the **Use keyless authentication for Azure services** checkbox is checked.
- For the **Vector store** option, select **Local on-disc (for prototyping)**.
* For the **Framework** option, select **.NET 9.0**.
* For the **AI service provider** option, select **Azure OpenAI**.
* Make sure the **Use keyless authentication for Azure services** checkbox is checked.
* For the **Vector store** option, select **Local on-disc (for prototyping)**.
1. Select **Create** to complete the process.

# [Visual Studio Code](#tab/visual-studio-code)
Expand Down Expand Up @@ -86,9 +86,9 @@ The AI template uses Microsoft Entra ID for seamless, keyless authentication. It

1. Assign a role to your developer account to access the Azure OpenAI resource:

- In the Azure Portal, navigate to the overview page of your Azure OpenAI resource.
- Select **Access control (IAM)** from the left navigation.
- [Add a role assignment](../../../azure/sdk/authentication/local-development-dev-accounts.md#assign-roles-to-the-group) for the `Azure AI Developer` role to your Azure account.
* In the Azure Portal, navigate to the overview page of your Azure OpenAI resource.
* Select **Access control (IAM)** from the left navigation.
* [Add a role assignment](../../../azure/sdk/authentication/local-development-dev-accounts.md#assign-roles-to-the-group) for the `Azure AI Developer` role to your Azure account.

1. [Sign-in to a local development tool](../../../azure/sdk/authentication/local-development-dev-accounts.md#sign-in-to-azure-using-developer-tooling) such as Visual Studio or the Azure CLI using the Azure account you assigned the `Azure AI Developer` role to.

Expand Down
12 changes: 6 additions & 6 deletions docs/ai/quickstarts/includes/ai-templates-explore-app.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
The sample app you created is a Blazor Interactive Server web app preconfigured with common AI and data services. The app handles the following concerns for you:
The sample app you created is a Blazor Interactive Server web app preconfigured with common AI and data services. The app template handles the following concerns for you:

- Includes essential `Microsoft.Extensions.AI` packages and other dependencies in the `csproj` file to help you get started working with AI.
- Includes essential `Microsoft.Extensions.AI` packages and other dependencies in the `.csproj` file to help you get started working with AI.
- Creates various AI services and registers them for dependency injection in the `Program.cs` file:
- An `IChatClient` service to chat back and forth with the generative AI model
- An `IEmbeddingGenerator` service that's used to generate embeddings, which are essential for vector search functionality
- A `JsonVectorStore` to act as an in-memory vector store
- Registers a SQLite database context service to handle ingesting documents. The app is preconfigured to ingest whatever documents you add to the `Data` folder of the project, including the provided example files.
- An `IChatClient` service to chat back and forth with the generative AI model.
- An `IEmbeddingGenerator` service that's used to generate embeddings, which are essential for vector search functionality.
- A `JsonVectorStore` to act as an in-memory vector store.
- Registers a SQLite database context service to handle ingesting documents. The app is preconfigured to ingest whatever documents you add to the `wwwroot/Data` folder of the project, including the provided example files.
- Provides a complete chat UI using Blazor components. The UI handles rich formatting for the AI responses and provides features such as citations for response data.
19 changes: 10 additions & 9 deletions docs/ai/quickstarts/includes/ai-templates-github-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ ms.author: alexwolf

## Prerequisites

* .NET 9.0 SDK - [Install the .NET 9.0 SDK](https://dotnet.microsoft.com/download)
* Visual Studio 2022 - [Install Visual Studio 2022](https://visualstudio.microsoft.com/) (optional), or
* Visual Studio Code - [Install Visual Studio Code](https://code.visualstudio.com) (optional)
* With the C# DevKit - [Install C# Dev Kit extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
* [.NET 9.0 SDK](https://dotnet.microsoft.com/download)
* One of the following IDEs (optional):
* [Visual Studio 2022](https://visualstudio.microsoft.com/)
* [Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)

## Install the .NET AI app template

Expand Down Expand Up @@ -79,20 +79,21 @@ The sample app you created is a Blazor Interactive Server web app preconfigured

## Configure access to GitHub Models

To authenticate to GitHub models from your code, you'll need to create a GitHub personal access token:
To authenticate to GitHub models from your code, you'll need to [create a GitHub personal access token](https://docs.github.com/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token):

1. Navigate to the **Personal access tokens** page of your GitHub account settings.
1. Navigate to the **Personal access tokens** page of your GitHub account settings under **Developer Settings**.
1. Select **Generate new token**.
1. Enter a **Token name** and then select **Generate token** at the bottom of the page.
1. Enter a name for the token, and under **Permissions**, set **Models** to **Access: Read-only**.
1. Select **Generate token** at the bottom of the page.
1. Copy the token for use in the steps ahead.

## Configure the app

The **AI Chat Web App** app is almost ready to go as soon as it's created. However, you'll need to configure the app to use the personal access token you setup for GitHub Modelsfor. 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** 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)

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. 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.

2. Add the following key and value:

Expand Down
8 changes: 4 additions & 4 deletions docs/ai/quickstarts/includes/ai-templates-ollama.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ ms.author: alexwolf

## Prerequisites

* .NET 9.0 SDK - [Install the .NET 9.0 SDK](https://dotnet.microsoft.com/download)
* Visual Studio 2022 - [Install Visual Studio 2022](https://visualstudio.microsoft.com/) (optional), or
* Visual Studio Code - [Install Visual Studio Code](https://code.visualstudio.com) (optional)
* With the C# DevKit - [Install C# Dev Kit extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
* [.NET 9.0 SDK](https://dotnet.microsoft.com/download)
* Ollama installed locally - [Install Ollama](https://ollama.com/) locally on your device
* One of the following IDEs (optional):
* [Visual Studio 2022](https://visualstudio.microsoft.com/)
* [Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)

## Install the .NET AI app template

Expand Down
10 changes: 5 additions & 5 deletions docs/ai/quickstarts/includes/ai-templates-openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ ms.author: alexwolf

## Prerequisites

* .NET 9.0 SDK - [Install the .NET 9.0 SDK](https://dotnet.microsoft.com/download)
* Visual Studio 2022 - [Install Visual Studio 2022](https://visualstudio.microsoft.com/) (optional), or
* Visual Studio Code - [Install Visual Studio Code](https://code.visualstudio.com) (optional)
* With the C# DevKit - [Install C# Dev Kit extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
* Access to an [OpenAI service](https://openai.com/api/) and the corresponding API key.
* [.NET 9.0 SDK](https://dotnet.microsoft.com/download)
* Access to an [OpenAI service](https://openai.com/api/) and the corresponding API key
* One of the following IDEs (optional):
* [Visual Studio 2022](https://visualstudio.microsoft.com/)
* [Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)

## Install the .NET AI app template

Expand Down