Teams Notification Provider Configuration Guide
This guide provides instructions on how to configure the Teams Notification provider,
1. For Public Webhooks
Teams can be configured to allow public webhooks. This means that anyone can send a message to a channel. To create a public webhook, follow the steps below.
1. Create a Webhook - Common steps for public and authenticated webhooks
- Log in to Entra ID with a user having write permissions to Power Automate ; Navigate to make.powerautomate.com.
- Click on Create -> Instant cloud flow.
- Give it a unuque flow name
- Click on When a Teams webhook request is received.
- Click on Create.
- Click on the block When a Teams webhook request is received.
- For Who can trigger the flow?, select Anyone.
- Click on the "+" icon below this step to add an action.
- Click on Add an action.
- Search for "Parse JSON". Under Data Operations click on Parse JSON.
- Click in the text box under Content, click on the blue bar to the right and select the spark like icon. Click on Body
- Under Schema click on "Use sample payload to generate schema".
- In the popup that appears, paste the following JSON payload:
{ "message": "My Message", "TeamID": "teamId", "ChannelID": "channelId" }
- Click on Done.
- Click on the "+" icon below Parse JSON to add an action.
- Click on Add an action.
- Click on Microsoft Teams under Add an action.
- Click on Post card in a chat or channel.
- Fill in the following details:
- Post As: Flow bot (keep unchanged)
- Post In: In drop down select Channel
- Team: Click in the text box, and in the blue bar to the right, click on fx. In search box under "Function" search for "body". Select triggerBody(). In the text box above edit the text to triggerBody()?['TeamID']. Click on Add
- Channel: Click in the text box, and in the blue bar to the right, click on "fx". In search box under "Function" search for "body". Select triggerBody(). In the text box above edit the text to triggerBody()?['ChannelID']. Click on Add
- Adaptive Card: Click in text box , and in the blue bar to the right, click on "fx". Click on Dynamic content. Click on Body message. Click on Add.
- Click on Save.
- Click on When a Teams webhook request is received and copy the HTTP URL.
2. Get the Channel ID and Team ID to post to
- In Teams, navigate to the channel you want to post to on the list of channels
- Click on the three dots next to the channel name.
- Click on Get link to channel.
- Copy the URL. The channel ID is the last part of the URL. The team ID is the part of the URL before the channel ID.
- For example if the link is "https://teams.microsoft.com/l/channel/XXX17f4%40thread.tacv2/test?groupId=f47c4a46-XXX" then the team ID is "f47c4a46-XXX" and the channel ID is "XXX17f4%40thread.tacv2".
3. Configure your Integration
- Ensure you have the following items
- Webhook URL: The URL copied from the "When a Teams webhook request is received" block.
- Channel ID: The channel ID copied from Teams.
- Team ID: The team ID copied from Teams.
- Create your integration by supplying the following values.
- Credential / WebhookUrl : Paste the webhook URL.
- ChannelId : Paste the channel ID.
- TeamId : Paste the team ID.
- Do not set the following parameters: Credential / OAuthClient , TenantId or Endpoint.
2. For Authenticated Webhooks
Teams can be configured to allow authenticated webhooks. This means that only users with the correct credentials (Tenant ID, Client ID and Client Secret) can send a message to a channel. To create an authenticated webhook, follow the steps below.
1. Create a Webhook - Common steps for public and authenticated webhooks
- Log in to Entra ID with a user having write permissions to Power Automate ; Navigate to make.powerautomate.com.
- Click on Create -> Instant cloud flow.
- Give it a unuque flow name
- Click on When a Teams webhook request is received.
- Click on Create.
- Click on the block When a Teams webhook request is received.
- For Who can trigger the flow?, select Any user in my tenant.
- Click on the "+" icon below this step to add an action.
- Click on Add an action.
- Search for "Parse JSON". Under Data Operations click on Parse JSON.
- Click in the text box under Content, click on the blue bar to the right and select the spark like icon. Click on Body
- Under Schema click on "Use sample payload to generate schema".
- In the popup that appears, paste the following JSON payload:
{ "message": "My Message", "TeamID": "teamId", "ChannelID": "channelId" }
- Click on Done.
- Click on the "+" icon below Parse JSON to add an action.
- Click on Add an action.
- Click on Microsoft Teams under Add an action.
- Click on Post card in a chat or channel.
- Fill in the following details:
- Post As: Flow bot (keep unchanged)
- Post In: In drop down select Channel
- Team: Click in the text box, and in the blue bar to the right, click on fx. In search box under "Function" search for "body". Select triggerBody(). In the text box above edit the text to triggerBody()?['TeamID']. Click on Add
- Channel: Click in the text box, and in the blue bar to the right, click on "fx". In search box under "Function" search for "body". Select triggerBody(). In the text box above edit the text to triggerBody()?['ChannelID']. Click on Add
- Adaptive Card: Click in text box , and in the blue bar to the right, click on "fx". Click on Dynamic content. Click on Body message. Click on Add.
- Click on Save.
- Click on When a Teams webhook request is received and copy the HTTP URL.
2. Get the Channel ID and Team ID to post to
- In Teams, navigate to the channel you want to post to on the list of channels
- Click on the three dots next to the channel name.
- Click on Get link to channel.
- Copy the URL. The channel ID is the last part of the URL. The team ID is the part of the URL before the channel ID.
- For example if the link is "https://teams.microsoft.com/l/channel/XXX17f4%40thread.tacv2/test?groupId=f47c4a46-XXX" then the team ID is "f47c4a46-XXX" and the channel ID is "XXX17f4%40thread.tacv2".
3. Create Azure AD App Registration
- Navigate to portal.azure.com and login with your Entra ID account having admin permissions.
- In search bar above, search for App registrations and click on it.
- Click on New registration.
- Fill in the following details:
- Name: Enter a name for the app registration.
- Supported account types: Select the appropriate account type. We suggest you use Accounts in any organizational directory (Any Microsoft Entra IO tenant - Multitenant).
- Redirect URI: Do not enter
- Click on Register.
- In the left pane, click on Certificates & secrets.
- Click on New client secret. Click Add.
- Copy the Value of the client secret. This is the client secret. You will not be able to see this value again. Copy the Secret ID as well. Store in a secure location. This will be the client ID and client secret.
- In the left pane, click on API permissions.
- Click on Add a permission.
- Click on Power Automate ; Click on User under Other permissions. Click on Add permissions.
- Click on Overview and copy the Directory (tenant) ID. This is the tenant ID.
4. Configure your Integration
- Ensure you have the following items
- Webhook URL: The URL copied from the "When a Teams webhook request is received" block.
- Channel ID: The channel ID copied from Teams.
- Team ID: The team ID copied from Teams.
- Tenant ID: The tenant ID copied from Azure AD App Registration.
- Client ID: The client ID copied from Azure AD App Registration.
- Client Secret: The client secret copied from Azure AD App Registration.
- Create your integration by supplying the following values.
- Endpoint : Paste the webhook URL.
- TenantId : Paste the tenant ID.
- Credential / OAuthClient / ClientId : Paste the client ID
- Credential / OAuthClient / ClientSecret : Paste the client secret.
- ChannelId : Paste the channel ID.
- TeamId : Paste the team ID.
- Do not set the following parameters: Credential / WebhookUrl.