Add .NET Copilot Studio sample agent#289
Open
Yogeshp-MSFT wants to merge 4 commits intomicrosoft:mainfrom
Open
Add .NET Copilot Studio sample agent#289Yogeshp-MSFT wants to merge 4 commits intomicrosoft:mainfrom
Yogeshp-MSFT wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new .NET 8 sample agent that proxies Agent 365 SDK messages to a published Copilot Studio agent (via Power Platform API), including auth (OBO), basic hosting, and observability scaffolding.
Changes:
- Introduces a new
dotnet/copilot-studio/sample-agent/project (agent + Copilot Studio client wrapper). - Adds OpenTelemetry/A365 observability helpers (metrics/tracing wrapper + OTEL configuration).
- Adds sample configuration, launch profiles, and a setup/troubleshooting README.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/copilot-studio/sample-agent/telemetry/AgentOTELExtensions.cs | OTEL setup for logging/metrics/tracing + health endpoint filtering. |
| dotnet/copilot-studio/sample-agent/telemetry/AgentMetrics.cs | Defines custom metrics and helper wrappers for “observed” operations. |
| dotnet/copilot-studio/sample-agent/telemetry/A365OtelWrapper.cs | Wraps agent operations with A365 baggage + exporter token-cache registration. |
| dotnet/copilot-studio/sample-agent/appsettings.json | Production-style configuration template (Copilot Studio + connections + observability). |
| dotnet/copilot-studio/sample-agent/appsettings.Playground.json | Playground/local config template with placeholders and comments. |
| dotnet/copilot-studio/sample-agent/README.md | Sample documentation: prerequisites, setup, architecture, troubleshooting. |
| dotnet/copilot-studio/sample-agent/Properties/launchSettings.json | Local launch profiles (Development + Playground). |
| dotnet/copilot-studio/sample-agent/Program.cs | ASP.NET host wiring, DI, authentication, routing, and endpoints. |
| dotnet/copilot-studio/sample-agent/CopilotStudioSampleAgent.csproj | New .NET 8 web project + package references. |
| dotnet/copilot-studio/sample-agent/Client/CopilotStudioAgentClient.cs | Copilot Studio invocation wrapper + factory and token provider. |
| dotnet/copilot-studio/sample-agent/AspNetExtensions.cs | JWT bearer validation setup (TokenValidation options). |
| dotnet/copilot-studio/sample-agent/Agent/MyAgent.cs | AgentApplication implementation (routing + typing loop + Copilot Studio call). |
| dotnet/copilot-studio/sample-agent/.gitignore | Ignores build artifacts and common secret/config outputs. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…elemetry metrics Co-authored-by: Copilot <copilot@github.com>
484e968 to
30fb5a7
Compare
Author
|
HI @ajmfehr can you review this and approve? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds a new .NET 8.0 sample demonstrating how to integrate a Microsoft Copilot Studio agent with the Agent 365 SDK. This is the .NET counterpart to the existing Node.js Copilot Studio sample.
What it does:
Microsoft.Agents.CopilotStudio.Clientfor OBO token-based invocationFiles added:
Agent/MyAgent.cs— message routing, install/uninstall handling, typing indicator loopClient/CopilotStudioAgentClient.cs— Copilot Studio client wrapper with OBO token providertelemetry/— A365 observability, metrics, and OTEL extensionsProgram.cs,AspNetExtensions.cs— DI setup and JWT validationappsettings.json/ appsettings.Playground.json — production and local dev configsPath:
dotnet/copilot-studio/sample-agent/