|
1 | | -# Copilot Studio Agents in Semantic Kernel |
| 1 | +# Semantic Kernel - CopilotStudioAgent Quickstart |
2 | 2 |
|
3 | | -## Overview |
| 3 | +This README provides an overview on how to use the `CopilotStudioAgent` within Semantic Kernel. |
| 4 | +This agent allows you to interact with Microsoft Copilot Studio agents through programmatic APIs. |
4 | 5 |
|
5 | | -// %%% TODO |
| 6 | +> ℹ️ **Note:** Knowledge sources must be configured **within** Microsoft Copilot Studio first. Streaming responses are **not currently supported**. |
6 | 7 |
|
| 8 | +--- |
| 9 | + |
| 10 | +## 🔧 Prerequisites |
| 11 | + |
| 12 | +2. Install `Microsoft.SemanticKernel.Agents.CopilotStudio` package: |
| 13 | + ```bash |
| 14 | + dotnet add package Microsoft.SemanticKernel.Agents.CopilotStudio --prerelease |
| 15 | + ``` |
| 16 | +3. An agent created in **Microsoft Copilot Studio** |
| 17 | +4. Ability to create an application identity in Azure for a **Public Client/Native App Registration**, |
| 18 | +or access to an existing app registration with the `CopilotStudio.Copilots.Invoke` API permission assigned. |
| 19 | + |
| 20 | +## Create a Copilot Agent in Copilot Studio |
| 21 | + |
| 22 | +1. Go to [Microsoft Copilot Studio](https://copilotstudio.microsoft.com). |
| 23 | +2. Create a new **Agent**. |
| 24 | +3. Publish your newly created Agent. |
| 25 | +4. In Copilot Studio, navigate to: |
| 26 | + `Settings` → `Advanced` → `Metadata` |
| 27 | + |
| 28 | + Save the following values: |
| 29 | + - `Schema Name` (maps to `agent_identifier`) |
| 30 | + - `Environment ID` |
| 31 | + |
| 32 | +## Create an Application Registration in Entra ID – User Interactive Login |
| 33 | + |
| 34 | +> This step requires permissions to create application identities in your Azure tenant. |
| 35 | + |
| 36 | +You will create a **Native Client Application Identity** (no client secret required). |
| 37 | + |
| 38 | +1. Open [Azure Portal](https://portal.azure.com) |
| 39 | +2. Navigate to **Entra ID** |
| 40 | +3. Go to **App registrations** → **New registration** |
| 41 | +4. Fill out: |
| 42 | + - **Name**: Any name you like |
| 43 | + - **Supported account types**: `Accounts in this organization directory only` |
| 44 | + - **Redirect URI**: |
| 45 | + - Platform: `Public client/native (mobile & desktop)` |
| 46 | + - URI: `http://localhost` |
| 47 | +5. Click **Register** |
| 48 | +6. From the **Overview** page, note: |
| 49 | + - `Application (client) ID` |
| 50 | + - `Directory (tenant) ID` |
| 51 | +7. Go to: `Manage` → `API permissions` |
| 52 | + - Click **Add permission** |
| 53 | + - Choose **APIs my organization uses** |
| 54 | + - Search for: **Power Platform API** |
| 55 | + |
| 56 | + If it's not listed, see **Tip** below. |
| 57 | +
|
| 58 | +8. Choose: |
| 59 | + - **Delegated Permissions** |
| 60 | + - Expand `CopilotStudio` |
| 61 | + - Select `CopilotStudio.Copilots.Invoke` |
| 62 | +9. Click **Add permissions** |
| 63 | +10. (Optional) Click **Grant admin consent** |
| 64 | +
|
| 65 | +### Tip |
| 66 | +
|
| 67 | +If you **do not see Power Platform API**, follow [Step 2 in Power Platform API Authentication](https://learn.microsoft.com/en-us/power-platform/admin/programmability-authentication-v2) to add the API to your tenant. |
0 commit comments