reference project for obo auth app registration#253
Open
meghanshubhatt wants to merge 1 commit intomainfrom
Open
reference project for obo auth app registration#253meghanshubhatt wants to merge 1 commit intomainfrom
meghanshubhatt wants to merge 1 commit intomainfrom
Conversation
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issuesdotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/AgentFrameworkSampleAgent.csproj
OpenSSF ScorecardScorecard details
Scanned Files
|
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/AspNetExtensions.cs
Dismissed
Show dismissed
Hide dismissed
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Agent/MyAgent.cs
Dismissed
Show dismissed
Hide dismissed
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/AspNetExtensions.cs
Dismissed
Show dismissed
Hide dismissed
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/AspNetExtensions.cs
Dismissed
Show dismissed
Hide dismissed
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Agent/MyAgent.cs
Dismissed
Show dismissed
Hide dismissed
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Agent/MyAgent.cs
Dismissed
Show dismissed
Hide dismissed
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Agent/MyAgent.cs
Dismissed
Show dismissed
Hide dismissed
...t/obo-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/A365OtelWrapper.cs
Dismissed
Show dismissed
Hide dismissed
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Agent/MyAgent.cs
Dismissed
Show dismissed
Hide dismissed
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/AspNetExtensions.cs
Dismissed
Show dismissed
Hide dismissed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new .NET Agent Framework sample under dotnet/obo-auth-samples/agent-framework-appRegistration/ that demonstrates manual Azure AD app registration for a Custom Engine Agent using Teams SSO + OBO, packaged for Docker deployment on Azure App Service, with OpenTelemetry/A365 observability and MCP tooling configuration.
Changes:
- Adds a complete runnable sample agent (ASP.NET host, agent implementation, tools, auth/token validation helpers, Dockerfile).
- Adds observability helpers (OpenTelemetry pipeline extensions, custom metrics/tracing wrappers) and documentation (README + detailed setup guide + design notes).
- Adds Teams sideloading assets (manifest + icons) and sample configuration files.
Reviewed changes
Copilot reviewed 19 out of 23 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/AgentOTELExtensions.cs | Adds OpenTelemetry configuration helpers for the sample. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/AgentMetrics.cs | Adds custom ActivitySource/Meter instrumentation helpers for HTTP + agent operations. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/A365OtelWrapper.cs | Wraps agent operations with A365 observability baggage + token registration. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/docs/design.md | Documents architecture and key flows for the sample. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/claude.md | Provides a step-by-step setup/deployment guide (manual app registration + bot + Docker/App Service + Teams). |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/appsettings.json | Default configuration template for OBO setup, AOAI, tooling, and logging. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/appsettings.Playground.json | Playground-specific configuration template. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/appPackage/outline.png | Teams app outline icon. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/appPackage/manifest.json | Teams app manifest template with placeholders for IDs/domains. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/appPackage/color.png | Teams app color icon. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Tools/WeatherLookupTool.cs | Adds a local tool for weather lookup via OpenWeatherMap. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Tools/DateTimeFunctionTool.cs | Adds a local tool for current date/time. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/ToolingManifest.json | Declares MCP server(s) for tool loading. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/README.md | Sample overview, prerequisites, and references to setup docs. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Program.cs | ASP.NET host wiring, DI, auth middleware, /api/messages + health endpoint, AOAI client setup. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Dockerfile | Multi-stage Docker build targeting port 8080. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/AspNetExtensions.cs | Adds JWT validation/authentication wiring for the sample. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/AgentFrameworkSampleAgent.csproj | Sample project definition and package references. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Agent/MyAgent.cs | Main agent implementation: handlers, SSO/OBO selection, tool loading, streaming/UX behavior. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/.gitignore | Sample-specific gitignore for local artifacts. |
| dotnet/obo-auth-samples/agent-framework-appRegistration/AgentFrameworkSample.sln | Adds a solution file for the new sample project. |
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/AgentMetrics.cs
Show resolved
Hide resolved
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/AgentMetrics.cs
Show resolved
Hide resolved
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Agent/MyAgent.cs
Show resolved
Hide resolved
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/README.md
Show resolved
Hide resolved
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/AgentMetrics.cs
Show resolved
Hide resolved
...o-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/AgentOTELExtensions.cs
Show resolved
Hide resolved
...t/obo-auth-samples/agent-framework-appRegistration/sample-agent/telemetry/A365OtelWrapper.cs
Show resolved
Hide resolved
...et/obo-auth-samples/agent-framework-appRegistration/sample-agent/appsettings.Playground.json
Show resolved
Hide resolved
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/AspNetExtensions.cs
Show resolved
Hide resolved
dotnet/obo-auth-samples/agent-framework-appRegistration/sample-agent/Tools/WeatherLookupTool.cs
Show resolved
Hide resolved
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.
feat: add Agent Framework sample with manual App Registration setup (OBO auth)
Description
Adds a new sample demonstrating how to set up a Custom Engine Agent using manual Azure AD app registration with On-Behalf-Of (OBO) authentication, deployed as a Docker container on Azure App Service.
This complements the existing
agent-frameworksample by showing the app-registration-based approach — useful for partners and scenarios where automated provisioning isn't available.What's included
Agent/MyAgent.csProgram.cs/api/messagesendpointappsettings.jsonappPackage/manifest.jsontelemetry/AgentMetrics.cstelemetry/A365OtelWrapper.cstelemetry/AgentOTELExtensions.csTools/DockerfileREADME.mdclaude.mddocs/design.mdKey features
api://botid-{appId}identifier URIGraphOBoConnectionOAuth connectionNotable fix
Fixed an
async voidbug inAgentMetrics.InvokeObservedHttpOperation— the method acceptedAction funcbut was called withasynclambdas, causing fire-and-forget behavior that crashed the container withObjectDisposedException. Changed toFunc<Task> funcwith properawait.Testing
/api/healthreturns 200