Connecting a Logic App to Microsoft Teams with Managed Identity

Alexandre G 71 Reputation points
2021-01-20T10:52:29.223+00:00

I'm currently creating a Logic App workflow to send a message to a Microsoft Teams canal when it is triggered by a HTTP request. I am using the "Post a message to a canal as the flow bot" action.

However, I'm currently using my personal account as a connection, which is a bad practice regarding long term maintainability.

I see that there is an option to connect with a Managed Identity. I successfully enabled the system-assigned Managed Identity for my Logic App by going to the Settings and then the Identity part. However, I do not know how to allow this Managed Identity access to a specific canal on Microsoft Teams to post messages to it. I could not find anything on the web.

58396-logic-app.png

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,551 questions
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

Accepted answer
  1. Sam Cogan 10,812 Reputation points Microsoft Employee Volunteer Moderator
    2021-01-20T13:51:10.257+00:00

    Your managed identity needs permissions to talk to the Teams API, in particular it needs to be able to access the Teams parts of the Graph API. A managed identity is just an AAD application behind the scenes so you can grant API rights to it. This article shows a script for granting access to Managed Identities to the Graph API. This page details the various Teams API's.

    2 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Steven Molen 0 Reputation points
    2024-12-13T18:00:46.6866667+00:00

    I think the OP was asking about the specific TEAMS tasks in Logic Apps using authentication methods other than an org account, which the answer on this thread doesn't really address. (just that there's an api out there and you can call that api with the right permissions with a service principal after doing all the oauth things to get the right token, how annoying).

    Honestly, I don't know how these connectors get past any kind of internal review without enterprise level auth in mind, which using a traditional org account for automation purposes is definitely not.

    1 person found this answer helpful.
    0 comments No comments

  2. OJA_AE 1 Reputation point
    2021-05-03T19:59:18.3+00:00

    Assigned literally every API-permission to the managed identity. Doesn't work.
    That said, the feature is still in preview.


  3. Kolundzija Nela (BSOT/PJ-AS-Bg) 0 Reputation points
    2024-04-02T11:40:49.2+00:00

    did anyone succeded to login to teams from logic app without personal account with service principle of managed identy ? thank you much needed help since want to persist all via terraform and not use my personal user for this

    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.