Add m365-langgraph-mcs-tool sample (Agents SDK + LangGraph + Copilot Studio) - #535
Open
adilei wants to merge 2 commits into
Open
Add m365-langgraph-mcs-tool sample (Agents SDK + LangGraph + Copilot Studio)#535adilei wants to merge 2 commits into
adilei wants to merge 2 commits into
Conversation
…Studio) A pro-code custom engine agent for Teams / Microsoft 365 Copilot, built with the M365 Agents SDK. It runs a LangGraph ReAct orchestrator on Azure OpenAI and exposes a published Copilot Studio agent as a tool, called with the signed-in user's identity (delegated SSO) with streamed responses. - One-command deploy: scripts/deploy.sh / deploy.ps1 (provision + deploy via atk). - Post-deploy smoke test: scripts/smoke-test.mjs (npm run smoke) over Direct Line. - Bicep infra: App Service, Azure Bot, user-assigned managed identity, SsoConnection + mcs OAuth connections, Entra app registration granting Power Platform (CopilotStudio.Copilots.Invoke). - Jekyll page + Azure/local deployment guides; registered in the Agents SDK category README. Cleaned Foundry-era leftovers carried from the source: removed unused deps (@azure/ai-agents, @azure/identity, @azure/core-auth, jsonwebtoken), the dead app-update-sso.bicep module, and stale Foundry references in docs/config. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c64fb4df-84d5-4146-84c2-65ade1d34a7c
The sample uses m365agents.yml, which the newer M365 Agents Toolkit CLI (`atk`, from @microsoft/m365agentstoolkit-cli) reads. The older `teamsapp` CLI reads teamsapp.yml and can't drive this sample, so relying on a specific global install was a rough edge for the one-command deploy. deploy.sh / deploy.ps1 now prefer a global `atk` and otherwise invoke `npx -y -p @microsoft/m365agentstoolkit-cli atk`, so provision/deploy work with no manual global install. Docs updated to mark the global CLI install as optional. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c64fb4df-84d5-4146-84c2-65ade1d34a7c
Collaborator
|
I've deployed this on Microsoft 365 Copilot. A few findings:
|
Collaborator
|
adilei I'm not sending a commit to address these because I wanted to confirm with you if you actually want to fix any of these or not? |
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.
What this adds
A new pro-code sample under
extensibility/agents-sdk/m365-langgraph-mcs-tool/: an M365 Agents SDK custom engine agent (publishable to Teams / M365 Copilot) that runs a LangGraph + Azure OpenAI ReAct orchestrator which calls a published Copilot Studio agent as a tool, with delegated SSO and streamed responses. The demo scenario is a hotel finder.Highlights
scripts/deploy.sh/deploy.ps1check prerequisites, prompt for the few required values, write env files, build, and runatk provision+atk deploy. If theatkCLI isn't installed globally, the scripts run it vianpx -y -p @microsoft/m365agentstoolkit-cli atkso there's no manual install step.npm run smoke(scripts/smoke-test.mjs, zero-dep ESM) drives the deployed bot over Direct Line, surfaces the one-time sign-in URL, and prints the streamed Copilot Studio reply.SsoConnection(Teams SSO) andmcs(Power Platform,CopilotStudio.Copilots.Invoke). Cloud bot uses a user-assigned managed identity (no secret). Provisioning is fully in Bicep (infra/).docs/AZURE_DEPLOYMENT.mdanddocs/LOCAL_DEPLOYMENT.md. Registered in the Agents SDK category README.Validation (static, no live creds)
npm run buildclean; compiled entry loads all modules (expected config error only).az bicep buildon bothazure.bicepandazure-local.bicep= 0 errors.bash -n/ pwsh parse on scripts OK;npx atk --versionresolves; smoke test fails gracefully when nothing is deployed; all doc links resolve.Not yet run
Live end-to-end deploy (
./scripts/deploy.sh+npm run smoke) requires an Azure subscription/RG, M365 tenant, a published Copilot Studio agent (environment id + schema), and an Azure OpenAI deployment/key — to be validated in a real environment.