Dynamically Adding Copilot Agent to Teams Group Chat Using Power Automate

Hemanth Kumar Chilamkurthi 0 Reputation points
2025-07-09T14:21:32.3166667+00:00

I have a Power Automate flow where I’m:

Creating a Teams group chat with three users using the built-in Create a chat action.

I also have the Copilot agent published in my Microsoft Teams channel and can chat with it in Microsoft Teams, as well as add it into group chats via the Add Agents option.

What I want to do next is dynamically add that agent into the newly created chat using Power Automate. Is there a way to achieve this with:

  • Any built-in Teams connector actions in Power Automate?
  • Or perhaps via a custom connector that could take the service principal/app ID and install the bot into the chat?

I’m looking for solutions or articles that address this issue. I have the necessary IDs (Service Principal and APP ID of the agent), and the chat exists, but I need to programmatically add the agent to it. Any suggestions or samples would be much appreciated!

Microsoft Copilot | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Karan Shewale 1,125 Reputation points Microsoft External Staff
    2025-07-11T03:45:43.7133333+00:00

    Hi Hemanth,

    Adding a Copilot agent to a Teams group chat programmatically is possible, though it requires some setup since there isn’t a direct built-in Power Automate action for this yet. The recommended approach is to create a custom connector in Power Automate that uses the Microsoft Graph API. You can call the endpoint POST https://graph.microsoft.com/v1.0/chats/{chat-id}/installedApps with the app ID of your agent to install it in the chat. In your flow, you would first create the group chat, get the chat ID from the response, and then call the custom connector to add the agent.

    Alternatively, you can use Power Automate’s HTTP action to run Teams PowerShell commands like Add-TeamsAppInstallation -ChatId "{chat-id}" -AppId "{agent-app-id}", or extend your bot using the Bot Framework/Direct Line API to add the agent to the chat.

    Key things to remember: your service principal needs the Graph API permissions Chat.ReadWrite and TeamsAppInstallation.ReadWriteForChat, and you should handle rate limits and errors carefully. If creating a custom connector isn’t feasible, another workaround is to trigger an Azure Function via webhook from Power Automate to perform the Graph API call.

    Official Documentation References:

    Thanks,  

    Karan Shewale. 

    *************************************************************************  

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.