feat(python): Add Copilot Studio sample agent#314
Open
Yogeshp-MSFT wants to merge 1 commit into
Open
Conversation
Author
|
Hi @biswapm can you review this pr ? |
8d83717 to
068fefd
Compare
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.
Summary
Adds a new Python sample that bridges Microsoft Copilot Studio low-code agents into the Agent 365 managed environment. Messages arriving through Agent 365 channels (Teams, email) are forwarded to a published Copilot Studio agent via
CopilotClient, and responses are relayed back — giving low-code agents access to enterprise identity, notifications, and observability.What's included
Patterns demonstrated
microsoft-agents-copilotstudio-client—CopilotClient+ConnectionSettingsfor Direct Line connectivityhttps://api.powerplatform.com/.defaultvia theAGENTICauth handlerAgenticTokenCachepattern — tokens acquired at runtime fromTurnContext, not static env vars.InferenceScopewraps every Copilot Studio callAgentNotification+EmailResponseactivity.from_propertyfields on every turninstallationUpdateactivityKey design decisions
A365_AGENT_APP_INSTANCE_ID/A365_AGENTIC_USER_IDenv vars — Observability tokens are acquired from the incomingTurnContextusing theAgenticTokenCachepattern per the Microsoft OpenTelemetry Distro docsAUTH_HANDLER_NAME=AGENTIC(uppercase) — must match the handler key inAGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__AGENTIC__...(Python dict lookup is case-sensitive)CopilotStudio.Copilots.Invokepermission required on the blueprint — configurable viaa365 setup permissions copilotstudiosrc/package) — matches the google-adk sample convention and simplifies Azure App Service deploymentHow to test
Tested end-to-end with:
az webapp deploy)HTTP 200 success, rejectedSpans: 0Dependencies
microsoft-agents-copilotstudio-client— Copilot Studio connectivitymicrosoft-agents-hosting-aiohttp/microsoft-agents-hosting-core— M365 Agents SDK hostingmicrosoft-agents-a365-notifications— Email/Teams notificationsmicrosoft-agents-a365-runtime— Observability token helpersmicrosoft-opentelemetry— OpenTelemetry distro (InferenceScope, BaggageBuilder, AgenticTokenCache)Related