Wednesday 13 May 2020

Provision Private Channels on Microsoft Teams with Tabs

Let us understand how to auto-provision a private channel on Microsoft Teams, along with necessary tabs added on the private channel in an automated way.

Article: Private channel provisioning along with necessary tabs could automated with the help of Power Automate flow and Microsoft Graph API. Microsoft Graph API provides us the beta/major version of the graph endpoints to achieve the provisioning solution. Power Automate flow is configured with necessary HTTP requests for provisioning and automate the process.

The solution requires two major steps.
  • Creating Private Channel
  • Adding Tabs


Create Private Channel on Microsoft Teams 


At the time of writing this article, private channel creation endpoint is not available with major version (v1.0). Major version of graph endpoint, provides option to create a channel, but not private channels.
POST https://graph.microsoft.com/v1.0/teams/{id}/channels
Content-type: application/json
{ "displayName": "Architecture Discussion", "description": "This channel is where we debate all future architecture plans" } 

The beta version of graph endpoint, provides option to create a private channel. The endpoint requires a payload to define the nature of channel and to add members with their roles. The following snapshot from Power Automate shows the way to create a private channel, with a member and their role.
Create a private channel
Create a private channel



Adding Tabs on Team Channels


The tab addition to channel is automated with the help of graph endpoint. The tabs can be list app/page/site. The end point for tabs is available for use for longtime now. More recently, Microsoft has announced the availability of endpoint for tab addition to channel. The below endpoint is used for listing tabs or to add tabs, based on the request type.
https://graph.microsoft.com/v1.0/teams/[team_id]/channels/[channel_id]/tabs 

To add tabs to the channel, the above endpoint should be used with the POST request, with required payload. The payload requires the tab name, and necessary configuration parameters. In our case the configuration parameters include the site URL.
Adding tab to channel
Adding tab to channel


Automated Provisioning


The following snapshot shows the configuration setup to automate the private channel provisioning, and tabs addition process. As we see, there are few additional steps to make sure that the channel is created and available for further steps for execution.
Channel Creation and Tab addition process Automated
Channel Creation and Tab addition process Automated