none
Azure Logic Apps and Posting a message to Microsoft Teams with Mentions RRS feed

  • Question

  • Today I tried to create an Azure Logic app that creates a message in a Channel within a Microsoft Teams team. 

     I wanted everybody to receive an alert using the Mentions in Microsoft Teams. My team name is Triad.Microsoft.Development so @Triad.Microsoft.Development should work.

    Even the code view looks ok to me:

    ~~~~
    {
    "inputs": {
    "host": {
    "connection": {
    "name": "@parameters('$connections')['teams']['connectionId']"
    }
    },
    "method": "post",
    "path": "/beta/groups/@{encodeURIComponent('2d7f5296-cf27-408e-9e5a-dac219e97084')}/channels/@{encodeURIComponent('12aad3df-90b5-433b-81ce-8e4c444bc127')}/chatThreads",
    "body": {
    "rootMessage": {
    "body": {
    "content": "PLEASE IGNORE THIS MESSAGE\n\nHi @Triad.Microsoft.Development, Please reply with what you were working on yesterday, what you are planning to work on today and if there are any impediments.",
    "contentType": 1
    }
    }
    },
    "authentication": "@parameters('$authentication')"
    }
    }
    ~~~~

    But now when I look at the Message in Teams:

    The Mention is being ignored and simply treated as plain text. So the next step is trying to edit the message:

    I also tried the same with Microsoft Flow and the same issue is there too. I guess Microsoft Flow and Azure Logic Apps are using the same engine in the background.

    Friday, October 13, 2017 9:01 AM

Answers

All replies

  • Hi Pieter,

    Try to escape the @. Something like:

    "content": "PLEASE IGNORE THIS MESSAGE\n\nHi @@Triad.Microsoft.Development, Please reply with what you were working on yesterday, what you are planning to work on today and if there are any impediments.",

    But I saw cases where mentions were not allowed in other connectors to avoid spams (if I am not wrong, the twitter connector doesn't allow that, but worth a try). What I am finding strange that the logic apps engine didn't complain about the @ sign by itself (as we use @ for expressions).

    I hope this helps, Wagner.

    Saturday, October 14, 2017 10:01 AM
  • The @@ doesn't escape the @. Did you try this in your environment? It doesn't seem to work for me. I don't have the feeling that the problem is the escaping of the @. 

    It looks like the mentions in Teams are resolved within the App itself.

    When using the API ( through Flow of Azure Logic Apps) the interface isn't used and therefore the group/user is never resolved.

    Monday, October 16, 2017 8:45 AM
  • Seems like you need to create a team app containing (atleast) a one way notification bot to be able to post to the activity feed.

    https://channel9.msdn.com/Events/Build/2017/P4132

    Tuesday, October 17, 2017 9:09 AM
  • This is currently a constraint of the Teams API.  
    Saturday, October 28, 2017 2:21 AM
    Owner