Skip to content

Commit ab09243

Browse files
Merge pull request #1772 from OfficeDev/v-mfurquan/Bot_Shared_Channel_Events
PR For Shared Channel Events
2 parents 82990ef + 1b2e250 commit ab09243

46 files changed

Lines changed: 3173 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-complete-samples.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,10 @@ jobs:
496496
name: 'bot-auth0-adaptivecard'
497497
version: '6.0.x'
498498

499+
- project_path: 'samples/bot-shared-channel-events/csharp/SharedChannelEvents/SharedChannelEvents.csproj'
500+
name: 'bot-shared-channel-events'
501+
version: '6.0.x'
502+
499503
- project_path: 'samples/graph-membership-change-notification/csharp/ChangeNotification/ChangeNotification.csproj'
500504
name: 'graph-membership-change-notification'
501505
version: '8.0.x'

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ The [Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDev
116116
| 30 | Requirement Targeting Mutual Dependency | Microsoft M365 RT sample app in Node.js which specifies mutual-dependency relationships between app capabilities using elementRelationshipSet. | Advanced | | [View][RequirementTargetingMutualDependency#nodejs] ![toolkit-icon](assets/toolkit-icon.png) | | |
117117
| 31 | Streaming Bot | This sample showcases the conversational streaming token scenario for teams bot in personal scope. | Advanced | [View][botstreaming#csharp] |[View][botstreaming#nodejs]![toolkit-icon](assets/toolkit-icon.png) | | |
118118
| 32 | Auth0 Bot | This sample demonstrates how to authenticate users in a Microsoft Teams bot using Auth0 login and retrieve their profile details. After authentication, the bot displays the user's name, email, and profile picture in an Adaptive Card. | Intermediate | [View][bot-auth0-adaptivecard#cs] ![toolkit-icon](assets/toolkit-icon.png) | [View][bot-auth0-adaptivecard#js] ![toolkit-icon](assets/toolkit-icon.png) | [View][bot-auth0-adaptivecard#python] ![toolkit-icon](assets/toolkit-icon.png) | | [View](/samples/bot-auth0-adaptivecard/csharp/demo-manifest/bot-auth0-adaptivecard.zip) |
119-
119+
| 33 | Bot Shared Channel Events | Microsoft Teams bot can receive transitive member add and remove events in shared channels.| Intermediate | [View][bot-shared-channel-events#cs] ![toolkit-icon](assets/toolkit-icon.png) | | | | |
120120

121121
#### Additional samples
122122
| No. | Sample Name | Description | Level | .NET | JavaScript |
@@ -552,6 +552,7 @@ The [Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDev
552552

553553
[bot-conversation#cs]:samples/bot-conversation/csharp
554554
[bot-auth0-adaptivecard#cs]:samples/bot-auth0-adaptivecard/csharp
555+
[bot-shared-channel-events#cs]:samples/bot-shared-channel-events/csharp
555556
[bot-file-upload#cs]:samples/bot-file-upload/csharp
556557
[bot-initiate-thread-in-channel#cs]:samples/bot-initiate-thread-in-channel/csharp
557558
[bot-message-reaction#cs]:samples/bot-message-reaction/csharp
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" Sdk="Microsoft.TeamsFx.Sdk">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>1694b6f5-8b63-41b6-8ba0-ca213f2a0449</ProjectGuid>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<None Include="aad.manifest.json" />
8+
<None Include="m365agents.local.yml" />
9+
<None Include="m365agents.yml" />
10+
</ItemGroup>
11+
<ItemGroup>
12+
<ProjectCapability Include="ProjectConfigurationsDeclaredDimensions" />
13+
</ItemGroup>
14+
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"id": "${{AAD_APP_OBJECT_ID}}",
3+
"appId": "${{AAD_APP_CLIENT_ID}}",
4+
"name": "shared-channel-events",
5+
"accessTokenAcceptedVersion": 2,
6+
"signInAudience": "AzureADMyOrg",
7+
"oauth2AllowIdTokenImplicitFlow": true,
8+
"oauth2AllowImplicitFlow": true,
9+
"optionalClaims": {
10+
"idToken": [],
11+
"accessToken": [
12+
{
13+
"name": "idtyp",
14+
"source": null,
15+
"essential": false,
16+
"additionalProperties": []
17+
}
18+
],
19+
"saml2Token": []
20+
},
21+
"requiredResourceAccess": [
22+
{
23+
"resourceAppId": "Microsoft Graph",
24+
"resourceAccess": [
25+
{
26+
"id": "User.Read",
27+
"type": "Scope"
28+
}
29+
]
30+
}
31+
]
32+
}
3.33 KB
Loading
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json",
3+
"manifestVersion": "1.19",
4+
"version": "1.0.0",
5+
"id": "${{TEAMS_APP_ID}}",
6+
"developer": {
7+
"name": "Microsoft",
8+
"websiteUrl": "https://www.microsoft.com",
9+
"privacyUrl": "https://www.microsoft.com/privacy",
10+
"termsOfUseUrl": "https://www.microsoft.com/termsofuse"
11+
},
12+
"name": {
13+
"short": "BotSharedChannelEvents",
14+
"full": "This sample demonstrates how to build Sample for Shared Channel events."
15+
},
16+
"description": {
17+
"short": "Teams Shared Channel events channelShared,channelUnshared with Bot Framework C#",
18+
"full": "This sample demonstrates how to build a Microsoft Teams bot using Bot Framework SDK for .NET that responds to shared channel events. When a channel is shared or unshared across teams, or when members are added/removed in the context of a shared channel,"
19+
},
20+
"icons": {
21+
"outline": "outline.png",
22+
"color": "color.png"
23+
},
24+
"bots": [
25+
{
26+
"botId": "${{AAD_APP_CLIENT_ID}}",
27+
"scopes": [
28+
"team",
29+
"personal"
30+
],
31+
"isNotificationOnly": false
32+
}
33+
],
34+
"supportedChannelTypes": [
35+
"sharedChannels"
36+
],
37+
"accentColor": "#60A18E",
38+
"permissions": [
39+
"identity",
40+
"messageTeamMembers"
41+
],
42+
"validDomains": [
43+
"${{BOT_DOMAIN}}",
44+
"token.botframework.com"
45+
],
46+
"webApplicationInfo": {
47+
"id": "${{AAD_APP_CLIENT_ID}}",
48+
"resource": "https://AnyString"
49+
},
50+
"authorization": {
51+
"permissions": {
52+
"resourceSpecific": [
53+
{
54+
"name": "ChannelMember.Read.Group",
55+
"type": "Application"
56+
}
57+
]
58+
}
59+
}
60+
}
407 Bytes
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file includes environment variables that can be committed to git. It's gitignored by default because it represents your local development environment.
2+
3+
# Built-in environment variables
4+
TEAMSFX_ENV=local
5+
APP_NAME_SUFFIX=local
6+
7+
# Generated during provision, you can also add your own variables.
8+
TEAMS_APP_ID=
9+
RESOURCE_SUFFIX=
10+
AZURE_SUBSCRIPTION_ID=
11+
AZURE_RESOURCE_GROUP_NAME=
12+
AAD_APP_CLIENT_ID=
13+
AAD_APP_OBJECT_ID=
14+
AAD_APP_TENANT_ID=
15+
AAD_APP_OAUTH_AUTHORITY=
16+
AAD_APP_OAUTH_AUTHORITY_HOST=
17+
TEAMS_APP_TENANT_ID=
18+
MICROSOFT_APP_TYPE=SingleTenant
19+
MICROSOFT_APP_TENANT_ID=
20+
TEAMSFX_M365_USER_NAME=
21+
22+
BOT_ENDPOINT=
23+
BOT_DOMAIN=
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@maxLength(20)
2+
@minLength(4)
3+
@description('Used to generate names for all resources in this file')
4+
param resourceBaseName string
5+
6+
@description('Required when create Azure Bot service')
7+
param botAadAppClientId string
8+
9+
param botAppDomain string
10+
11+
@maxLength(42)
12+
param botDisplayName string
13+
14+
param botServiceName string = resourceBaseName
15+
param botServiceSku string = 'F0'
16+
param microsoftAppType string
17+
param microsoftAppTenantId string
18+
19+
// Register your web service as a bot with the Bot Framework
20+
resource botService 'Microsoft.BotService/botServices@2021-03-01' = {
21+
kind: 'azurebot'
22+
location: 'global'
23+
name: botServiceName
24+
properties: {
25+
displayName: botDisplayName
26+
endpoint: 'https://${botAppDomain}/api/messages'
27+
msaAppId: botAadAppClientId
28+
msaAppType: microsoftAppType
29+
msaAppTenantId: microsoftAppType == 'SingleTenant' ? microsoftAppTenantId : ''
30+
}
31+
sku: {
32+
name: botServiceSku
33+
}
34+
}
35+
36+
// Connect the bot service to Microsoft Teams
37+
resource botServiceMsTeamsChannel 'Microsoft.BotService/botServices/channels@2021-03-01' = {
38+
parent: botService
39+
location: 'global'
40+
name: 'MsTeamsChannel'
41+
properties: {
42+
channelName: 'MsTeamsChannel'
43+
}
44+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"resourceBaseName": {
6+
"value": "bot${{RESOURCE_SUFFIX}}"
7+
},
8+
"botAadAppClientId": {
9+
"value": "${{AAD_APP_CLIENT_ID}}"
10+
},
11+
"botAppDomain": {
12+
"value": "${{BOT_DOMAIN}}"
13+
},
14+
"botDisplayName": {
15+
"value": "shared-channel-events"
16+
},
17+
"microsoftAppType": {
18+
"value": "${{MICROSOFT_APP_TYPE}}"
19+
},
20+
"microsoftAppTenantId": {
21+
"value": "${{MICROSOFT_APP_TENANT_ID}}"
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)