Solution Overview - OfficeDev/microsoft-teams-apps-groupactivities GitHub Wiki

Solution overview

Bot Components

  • Group Activities bot: The app service implements the bot and messaging extension experience by providing end points for user communication.
  • Azure table storage: Table storage is used to store group activity data and team users mapped to each group.
  • Microsoft Graph APIs: The app leverages Microsoft Graph APIs for Create channel, Get channel list, List owners etc.

Group Activities Bot

App service will host one web app built on ASP.NET CORE 2.1 for running bot service. Azure bot service is developed using BOT SDK v4.

The app majorly performs below actions -

  • Provides user sign in flow using Bot service AAD v2 connection settings to get all users in team

  • Gets logged in users role in team

  • Gets list of existing channels in team and creates new channels using Create channel Graph API. Uses delegated permission to create standard and public channels. Application will use AAD app registration and graph scope which requires tenant admin approval to perform channel creation operation.

  • Group activity notifications are send to users till assignment due date. Application is using IHostedService to run the background job to send the notification at 10 AM (UTC Timezone) and 5 PM (UTC Timezone). Notification will be sent to public channels.

  • Application fetch data from azure table storage to show recent group creation activities in Messaging Extension. More details on table schema can be found here.

  • Task module invoked for creating groups and channels by clicking on the ‘+’ icon of the associated messaging extension uses adaptive card input form.

Azure Table storage

Azure Table storage to store group activity data and user to group mapping. Details are provided in data stores section.

Microsoft Graph APIs

Application creates private and public channels which requires delegated permission and requires tenant admin to provide consent.

Sr. No. Use Case API Delegated permissions API version
1. Create channel POST https://graph.microsoft.com/beta/teams/{id}/channels Group.ReadWrite.All Beta
2. Get list of existing channels GET https://graph.microsoft.com/beta/teams/{id}/channels Group.Read.All Beta
3. Get owners of team GET https://graph.microsoft.com/v1.0/groups/{id}/owners Group.Read.All, User.Read.All V1.0