Quickstart: Send a chat message in Power Automate
You can create automated workflows that send chat messages by using the Azure Communication Services Chat connector. This quickstart shows you how to create a chat, add a participant, send a message, and list messages in an existing workflow.
Prerequisites
An Azure account with an active subscription, or create an Azure account for free.
An active Azure Communication Services resource, or create a Communication Services resource.
An active Azure Logic Apps resource, or create a blank logic app with the trigger that you want to use. Currently, the Communication Services Chat connector provides only actions, so your logic app requires a trigger, at minimum.
Create user
Complete these steps in Power Automate with your Power Automate flow open in edit mode.
To add a new step in your workflow by using the Communication Services Identity connector:
In the designer, under the step where you want to add the new action, select New step. Alternatively, to add the new action between steps, move your pointer over the arrow between those steps, select the plus sign (+), and then select Add an action.
In the Choose an operation search box, enter Communication Services Identity. In the list of actions list, select Create a user.
Enter the connection string. To get the connection string URL in the Azure portal, go to the Azure Communication Services resource. In the resource menu, select Keys, and then select Connection string. Select the copy icon to copy the connection string.
Enter a name for the connection.
Select Show advanced options, and then select the token scope. The action generates an access token and its expiration time with the specified scope. This action also generates a user ID that's a Communication Services user identity.
In Token Scopes Item, select chat.
Select Create. The user ID and an access token are shown.
Create a chat thread
Add a new action.
In the Choose an operation search box, enter Communication Services Chat. In the list of actions, select Create chat thread.
Enter the Communication Services endpoint URL. To get the endpoint URL in the Azure portal, go to the Azure Communication Services resource. In the resource menu, select Keys, and then select Endpoint.
Enter a name for the connection.
Select the access token that was generated in the preceding section, and then add a chat thread topic description. Add the created user and enter a name for the participant.
Send a message
Add a new action.
In the Choose an operation search box, enter Communication Services Chat. In the list of actions, select Send message to chat thread.
Enter the access token, thread ID, content, and name.
List chat thread messages
To verify that you sent a message correctly:
Add a new action.
In the Choose an operation search box, enter Communication Services Chat. In the list of actions, select List chat thread messages.
Enter the access token and thread ID.
Test your logic app
To manually start your workflow, on the designer toolbar, select Run. The workflow creates a user, issues an access token for that user, and then removes the token and deletes the user. For more information, review How to run your workflow.
Now, select List chat thread messages. In the action outputs, check for the message that was sent.
Clean up resources
To remove a Communication Services subscription, delete the Communication Services resource or resource group. Deleting the resource group also deletes any other resources in that group. For more information, review How to clean up Communication Services resources.
To clean up your logic app workflow and related resources, review how to clean up Logic Apps resources.
Next steps
In this quickstart, you learned how to create a user, create a chat thread, and send a message by using the Communication Services Identity and Communication Services Chat connectors. To learn more, review Communication Services Chat connector.
Learn how to create and manage Communication Services users and access tokens.
Learn how to send an email message in Power Automate by using Communication Services.
Feedback
Submit and view feedback for