-
Notifications
You must be signed in to change notification settings - Fork 325
feat(ai.agents): native Azure Bot + Teams channel for activity-protocol agents #8939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
v1212
wants to merge
18
commits into
Azure:main
Choose a base branch
from
v1212:feat/activity-protocol-simple
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,522
−59
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d0fa0b5
feat(ai.agents): native Azure Bot + Teams channel for activity-protoc…
4afe284
feat(ai.agents): support activity_protocol in init-from-code
9a01f03
fix(ai.agents): satisfy go-fix modernization and cspell CI
60c04d1
feat(ai.agents): write generic Teams app setup guide after activity d…
cb0a2b7
fix(ai.agents): tighten file/dir perms for gosec (G306/G301)
ef1808a
fix(ai.agents): globally-unique bot name + clearer postdeploy error
e2a76c6
docs(ai.agents): give concrete step-by-step Teams packaging + sideloa…
6cbb3bf
docs(ai.agents): make Teams sideload self-serve; tenant admin only as…
bd851b5
docs(ai.agents): add optional CLI path (zip package + atk sideload)
4258194
style(ai.agents): gofmt string concatenation in Teams guide
a3f7bfd
Merge remote-tracking branch 'origin/main' into feat/activity-protoco…
Copilot 0e67902
Address Copilot review nits: bots[].botId wording, errors.AsType, beh…
Copilot ea1abee
fix(ai.agents): address trangevi review on activity-protocol PR
Copilot 536335d
fix(ai.agents): decouple activity bot provisioning from optimization-…
Copilot aedd74f
Allow Activity protocol to coexist with other protocols
Copilot c140656
Add end-to-end coexistence regression for both init paths
Copilot 3a90c84
Merge remote-tracking branch 'origin/main' into feat/activity-protoco…
Copilot d026d68
refactor(ai.agents): move test-only ActivityAgentEndpoint into test f…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
99 changes: 99 additions & 0 deletions
99
cli/azd/extensions/azure.ai.agents/internal/cmd/assets/teams_app_setup_guide.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # Connect {{.AgentName}} to Microsoft Teams | ||
|
|
||
| `azd deploy` already did the Azure side for you: | ||
|
|
||
| - Azure Bot: `{{.BotName}}` (Microsoft Teams channel enabled) | ||
| - Bot ID (msaAppId): `{{.MsaAppID}}` <- you will paste this as the bot id | ||
|
|
||
| Two manual steps remain: (A) create a Teams app package, then (B) upload it. | ||
| They are the same for any activity-protocol agent. | ||
|
|
||
| ## A. Create the Teams app package | ||
|
|
||
| Pick ONE of the two ways below. | ||
|
|
||
| ### Easiest — Teams Developer Portal (no files by hand) | ||
|
|
||
| 1. Open https://dev.teams.microsoft.com/apps and select **+ New app**; enter a name. | ||
| 2. Fill **Basic information** (short/long description, developer name and URLs). | ||
| 3. Left menu **App features** -> **Bot** -> **Select an existing bot** -> enter the | ||
| Bot ID `{{.MsaAppID}}`, tick the **Personal** scope, then **Save**. | ||
| 4. **Publish** -> **Download the app package** — this gives you a ready-to-upload .zip. | ||
|
|
||
| Developer Portal guide: https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/teams-developer-portal | ||
|
|
||
| ### Or by hand — build the .zip yourself | ||
|
|
||
| Put these three files in a folder and zip them at the **root** (not inside a subfolder): | ||
|
|
||
| - `manifest.json` (below) | ||
| - `color.png` — 192x192 px | ||
| - `outline.png` — 32x32 px, transparent background | ||
|
|
||
| ```json | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json", | ||
| "manifestVersion": "1.19", | ||
| "version": "1.0.0", | ||
| "id": "REPLACE-WITH-A-NEW-GUID", | ||
| "developer": { | ||
| "name": "Your Company", | ||
| "websiteUrl": "https://example.com", | ||
| "privacyUrl": "https://example.com/privacy", | ||
| "termsOfUseUrl": "https://example.com/terms" | ||
| }, | ||
| "name": { "short": "{{.AgentName}}", "full": "{{.AgentName}}" }, | ||
| "description": { "short": "{{.AgentName}} agent", "full": "{{.AgentName}} agent on Microsoft Teams" }, | ||
| "icons": { "color": "color.png", "outline": "outline.png" }, | ||
| "accentColor": "#FFFFFF", | ||
| "bots": [{ "botId": "{{.MsaAppID}}", "scopes": ["personal"] }] | ||
| } | ||
| ``` | ||
|
|
||
| Note: `id` is a NEW GUID for the app itself (generate one) — it is NOT the Bot ID. | ||
| Only `bots[].botId` uses the Bot ID above. | ||
|
|
||
| - Package + icon requirements: https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/apps-package | ||
| - Manifest schema reference: https://learn.microsoft.com/microsoftteams/platform/resources/schema/manifest-schema | ||
| - Validate your .zip before uploading: https://dev.teams.microsoft.com/tools/store-validation | ||
|
|
||
| ## B. Upload (sideload) the app — just for yourself | ||
|
|
||
| You do NOT need a Teams admin to try it yourself: | ||
|
|
||
| 1. In Teams, go to **Apps** -> **Manage your apps** -> **Upload an app**. | ||
| 2. Select **Upload a custom app**, choose your .zip, then **Add**. | ||
| 3. Select **Open**, then send a message to talk to your agent. | ||
|
|
||
| Upload a custom app guide: https://learn.microsoft.com/microsoftteams/platform/concepts/deploy-and-publish/apps-upload | ||
|
|
||
| If **Upload a custom app** is missing or greyed out, custom app upload is turned off for | ||
| your tenant, or you want everyone in your org to get it from the org app catalog. Both need | ||
| a Teams admin: https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/prepare-your-o365-tenant | ||
|
|
||
| ## C. Optional — do both from the command line | ||
|
|
||
| Steps A and B can be scripted. This is a convenience path for repeat runs; it needs extra | ||
| tooling and does NOT bypass the tenant custom-app-upload setting above. | ||
|
|
||
| Package: put the manifest.json from section A (its Bot ID is already filled in) next to your | ||
| two icons, then zip the three files at the root: | ||
|
|
||
| ```sh | ||
| zip -j {{.AgentName}}-teams-app.zip manifest.json color.png outline.png # bash | ||
| ``` | ||
| ```powershell | ||
| Compress-Archive manifest.json,color.png,outline.png {{.AgentName}}-teams-app.zip # PowerShell | ||
| ``` | ||
|
|
||
| Sideload for yourself with the Microsoft 365 Agents Toolkit CLI (atk). `--scope Personal` is a | ||
| per-user install and needs NO Teams admin: | ||
|
|
||
| ```sh | ||
| npm install -g @microsoft/m365agentstoolkit-cli # one-time; requires Node.js | ||
| atk auth login # sign in with your M365 account | ||
| atk install --file-path {{.AgentName}}-teams-app.zip --scope Personal | ||
| ``` | ||
|
|
||
| atk prints a TitleId and a Teams deep link you can open to launch the agent. | ||
| atk CLI reference: https://learn.microsoft.com/microsoftteams/platform/toolkit/microsoft-365-agents-toolkit-cli |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This folds every selected protocol into the endpoint so activity can coexist with responses/invocations, but the PR description says activity is exclusive and rejected when combined (via a validateProtocolSelection that does not exist in the tree). As written there is no guard against an agent selecting activity plus responses, and postdeploy will then bind one bot to the activityProtocol messaging endpoint while the agent still advertises responses. Can we pin down the intended contract? If activity is meant to be exclusive, this call and ComposeActivityAgentEndpoint's multi-append logic reduce to ActivityAgentEndpoint(); if coexistence is intended, let's add validation or test coverage for the mixed case and correct the description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coexistence is the intended contract.
validateProtocolSelectionwas removed in this revision (that's why it isn't in the tree) — the PR description is stale and I'll update it to drop the "exclusive/rejected" wording.Mixed-case coverage is already in:
init_from_code_test.go— an activity+responses selection now yields endpoint protocols[activity, responses](no rejection).TestComposeActivityAgentEndpoint— a coexistence subtest, plus legacy-normalization and existing-schemes-preserved cases.On postdeploy: the bot binds only the activity messaging endpoint (activity's inbound channel); responses/invocations stay served on their own protocol routes as siblings, matching the service's per-protocol config, so advertising them alongside activity is intentional and unaffected. Pure-activity output stays byte-identical to the old
ActivityAgentEndpoint().