1

We have a sideloaded Microsoft Teams bot (called Axel), fully operational and running in production. The bot is able to send messages (including proactive), receive messages, etc.

However, users cannot initiate a conversation with the bot -- the bot MUST send a message first for it to work. I believe this is not expected / desired behavior. When searching for the bot in the search tab, we find it, but when clicking on its name nothing happens.

How can we make it possible for users to initiate conversations with the bot?

Screenshot

Edit: here is our redacted manifest.json file

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.3/MicrosoftTeams.schema.json",
    "manifestVersion": "1.3",
    "version": "1.0.0",
    "id": "{app_id}",
    "packageName": "com.package.name",
    "developer": {
        "name": "HeyAxel",
        "websiteUrl": "https://heyaxel.com",
        "privacyUrl": "https://www.heyaxel.com/files/Privacy_Policy.pdf",
        "termsOfUseUrl": "https://www.heyaxel.com/files/Privacy_Policy.pdf"
    },
    "icons": {
        "color": "color.png",
        "outline": "outline.png"
    },
    "name": {
        "short": "Axel",
        "full": "Axel"
    },
    "description": {
        "short": "shortdesc",
        "full": "fulldesc"
    },
    "accentColor": "#F9F9FA",
    "bots": [
        {
            "botId": "{bot_id}",
            "scopes": [
                "team"
            ],
            "supportsFiles": true,
            "isNotificationOnly": false
        }
    ],
    "permissions": [
        "identity",
        "messageTeamMembers"
    ],
    "validDomains": [
        "{domain1}",
        "{domain2}"
    ]
}

The bot in the Teams > Apps tab

Scopes & permissions displayed to users

Translation of scopes:

  • Receive messages & data from me
  • Send me messages & notification
  • Access profile info
  • Receive messages & data from users in channels
  • Send messages & notifications in a channel Access team information
Konrad
  • 852
  • 11
  • 31
  • It is not indeed a normal behaviour : you should check your configuration [doc](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bot-conversations/bots-conv-personal) says `Team owners and users with the appropriate permissions can also add bots as team members (see Interact in a team channel), which not only makes them available in that team's channels, but for personal chat for all of those users as well.` – B. Lec Jul 18 '19 at 09:37
  • try to re-publish it https://learn.microsoft.com/en-us/microsoftteams/tenant-apps-catalog-teams – B. Lec Jul 18 '19 at 09:40
  • Thanks @B.Lec. I would like to avoid re-publishing as it is an overhead and potentially error-prone for a production app & requires external IT support (in a customer's tenant). I'll try locally and see if it changes anything. To answer 1. Indeed, the bot was added to a team and it IS available to users (users can see the bot and interact with it normally IF the bot has previously messaged them) – Konrad Jul 18 '19 at 10:15
  • Strange things, will follow this topic – Nicolas R Jul 18 '19 at 10:59
  • If your bot's purpose is to deliver notification to users and is not conversational, you can set the isNotificationOnly field to true in your app manifest else disable it to initiate conversation with your bot. Follow the doc for adding field in app manifest [Notification only bots](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-notification-only). – Trinetra-MSFT Jul 18 '19 at 13:31
  • How have you sideloaded it? Via an app package with manifest.json? Does it show up in the list of Apps for a team in team properties? – Bill Bliss - MSFT Jul 18 '19 at 16:48
  • @Konrad That's a very odd issue. Can you share your manifest.json (`App Studio > Manifest editor > YourBot > Test and distribute > Download`)? Feel free to obfuscate the appIds, etc. Any chance that you don't have the Teams Channel enabled? – mdrichardson Jul 18 '19 at 20:05
  • I have shared our manifest in my edited question, with some screenshots of how it looks in Apps @mdrichardson-MSFT. What do you mean by having the "Teams Channel" enabled? The bot is registered through Microsoft Bot Framework with Teams enabled. It works 100% as intended except for the specific fact users cannot message it (though they can search it) first. – Konrad Jul 19 '19 at 09:59
  • @Konrad Pretty sure I found the answer. Let me know if that doesn't work. By "enabling the teams channel", I mean Azure Portal > Web App Bot > Channels, then ensure Teams Channel is enabled. It probably is, but just wanted to make sure. – mdrichardson Jul 19 '19 at 14:57
  • I can't find this option, my bot was made using the microsoft bot framework service. It has not been "migrated" ("optional" and apparently optional for Teams -- https://learn.microsoft.com/en-us/azure/bot-service/bot-service-migrate-bot?view=azure-bot-service-3.0) Should I migrate the bot? I'm using the settings at https://dev.botframework.com/ – Konrad Jul 20 '19 at 15:04
  • @Konrad I've added more clear instructions for enabling the Teams Channel to my answer. You shouldn't need to migrate, but you may as well try. It might not hurt to try making a new App Registration and see if it works, then. – mdrichardson Jul 22 '19 at 14:59
  • Thanks a lot @mdrichardson-MSFT the issue was the "personal" scope, that's all I changed – Konrad Jul 25 '19 at 13:42

1 Answers1

2

Your bot only has the "team" scope enabled.

  1. Open your manifest.json in App Studio.
  2. Go to the Bots section
  3. Click Edit
  4. Enable the Personal scope

enter image description here

Alternatively, you can just add the scope manually, then re-sideload/publish your bot.

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.3/MicrosoftTeams.schema.json",
    "manifestVersion": "1.3",
    "version": "1.0.0",
    "id": "{app_id}",
    "packageName": "com.package.name",
    "developer": {
        "name": "HeyAxel",
        "websiteUrl": "https://heyaxel.com",
        "privacyUrl": "https://www.heyaxel.com/files/Privacy_Policy.pdf",
        "termsOfUseUrl": "https://www.heyaxel.com/files/Privacy_Policy.pdf"
    },
    "icons": {
        "color": "color.png",
        "outline": "outline.png"
    },
    "name": {
        "short": "Axel",
        "full": "Axel"
    },
    "description": {
        "short": "shortdesc",
        "full": "fulldesc"
    },
    "accentColor": "#F9F9FA",
    "bots": [
        {
            "botId": "{bot_id}",
            "scopes": [
                "team",
                "personal",
                "groupchat"
            ],
            "supportsFiles": true,
            "isNotificationOnly": false
        }
    ],
    "permissions": [
        "identity",
        "messageTeamMembers"
    ],
    "validDomains": [
        "{domain1}",
        "{domain2}"
    ]
}

Also, be sure that you've enabled the Teams Channel by going to:

  1. Azure Portal
  2. Your Resource Group
  3. Your Web App Bot or Bot Channels Registration Service
  4. Channels
  5. Enable the Teams Channel

enter image description here

mdrichardson
  • 7,141
  • 1
  • 7
  • 21