This guide provides instructions on how to configure the Teams Notification provider,
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.
- 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 unique 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 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 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, select enter custom value, then click on the spark icon spark icon (⚡️) and select Body TeamID
- Channel: Click in the text box, select enter custom value, then click on the spark icon spark icon (⚡️) and select Body ChannelID
- Adaptive Card: Click in text box , and in the blue bar to the right, then click on the spark icon spark icon (⚡️) and select Body message
- Click on Save.
- Click on When a Teams webhook request is received and copy the HTTP URL.
- 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".
- 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.
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.
- 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 unique 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, select enter custom value, then click on the spark icon spark icon (⚡️) and select Body TeamID
- Channel: Click in the text box, select enter custom value, then click on the spark icon spark icon (⚡️) and select Body ChannelID
- Adaptive Card: Click in text box , and in the blue bar to the right, then click on the spark icon spark icon (⚡️) and select Body message
- Click on Save.
- Click on When a Teams webhook request is received and copy the HTTP URL. When using authenticated webhooks, you need to delete everything in the URL after the
?api-version=2016-06-01. For example, if you got the URLhttps://prod-12.westus.logic.azure.com:443/workflows/a3ffef4e6425a2fee5655483e85c4fae/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=AZw0NBwqEmIPcl-JfAaZurtv5IJo7031ObZgBNw7_I3, the endpoint URL you need to use ishttps://prod-12.westus.logic.azure.com:443/workflows/a3ffef4e6425a2fee5655483e85c4fae/triggers/manual/paths/invoke?api-version=2016-06-01.
- 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".
- 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. Store in a secure location. This will be the 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.
- On the Overview page, copy the Application (client) ID. This will be the client ID.
- 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.