botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[MS Teams] I need help with sideloading my bot correctly.

Open megancooper opened this issue 9 years ago • 30 comments

I am trying to side load my bot but I am finding the process for constructing the manifest.json file confusing? I created a manifest like this:

{
  "$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
  "manifestVersion": "1.0",
  "version": "1.0.0",
  "id": "ID",
  "packageName": "com.CORRECTURL",
  "developer": {
    "name": "Megan",
    "websiteUrl":    "https://website.com/",
    "privacyUrl":    "https://website.com/privacy",
    "termsOfUseUrl": "https://website.com/app-tos"
  },
  "name": {
    "short": "BotName"
  },
  "description": {
    "short": "A Bot",
    "full": "This is a bot."
  },
  "icons": {
    "outline":"outline.png",
    "color": "color.png"
  },
  "accentColor": "#FF0000",
  "bots": [
    {
      "botId": "ID",
      "needsChannelSelector":  "false",
      "scopes": ["personal", "team"]
    }
  ]
}

... And the bot was successfully sideloaded. But when I try to chat with my bot I can't see it? The bot is added to my team but it is not being recognized for some reason. Is this because I forgot to add something to the manifest?

megancooper avatar Jun 22 '17 14:06 megancooper

@megancooper Check out the official guide here: https://msdn.microsoft.com/en-us/microsoft-teams/sideload

nwhitmont avatar Jun 22 '17 14:06 nwhitmont

@megancooper for reference are you using .NET or Node SDK?

nwhitmont avatar Jun 22 '17 14:06 nwhitmont

Here's the full manifest schema reference which will help you validate your manifest. https://msdn.microsoft.com/en-us/microsoft-teams/schema

nwhitmont avatar Jun 22 '17 14:06 nwhitmont

@nwhitmont I'm using .net

megancooper avatar Jun 22 '17 15:06 megancooper

@nwhitmont I need help setting the bot up so members of my team can have a private conversation with the bot. Right now the bot is only available via @mentions in our main group chat. How can I specify this in the manifest? Thanks for the help.

megancooper avatar Jun 22 '17 16:06 megancooper

Quick MS Teams bot deployment checklist:

nwhitmont avatar Jun 22 '17 16:06 nwhitmont

@megancooper In your manifest file - replace "ID" (in both places) with your bot's Microsoft App ID that you used to register the bot.

{
  "$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
  "manifestVersion": "1.0",
  "version": "1.0.0",
  "id": "MICROSOFT_APP_ID_GOES_HERE",
  "packageName": "com.CORRECTURL",
  "developer": {
    "name": "Megan",
    "websiteUrl":    "https://website.com/",
    "privacyUrl":    "https://website.com/privacy",
    "termsOfUseUrl": "https://website.com/app-tos"
  },
  "name": {
    "short": "BotName"
  },
  "description": {
    "short": "A Bot",
    "full": "This is a bot."
  },
  "icons": {
    "outline":"outline.png",
    "color": "color.png"
  },
  "accentColor": "#FF0000",
  "bots": [
    {
      "botId": "MICROSOFT_APP_ID_GOES_HERE",
      "needsChannelSelector":  "false",
      "scopes": ["personal", "team"]
    }
  ]
}

nwhitmont avatar Jun 22 '17 17:06 nwhitmont

@nwhitmont It wasn't an ID Issue, I redacted that for privacy. I did all these steps, and I think I figured it out. But now I'm getting an error that says:

Error while reading manifest.json: Invalid value(s) specified for icons.outline.filesize: "2098" Invalid value(s) specified for icons.color.filesize: "10450"

I've double checked both PNGs in my zip folder and they are the correct pixel sizes. My outline is 20x20 and color is 96x96. Is there another cause for this error?

megancooper avatar Jun 22 '17 20:06 megancooper

Your image files are too large. There is a limitation on icons file size:

With the new sideloading process, the transparent .png icons that you reference in the manifest must now be smaller than ~1.5KB. Alternatively, you can reference the icon using a URL on a publicly accessible server, instead of a local path to icons inside the zip package: the size limit does not apply in this case.

https://msdn.microsoft.com/en-us/microsoft-teams/troubleshooting#error-while-reading-manifestjson

nwhitmont avatar Jun 22 '17 21:06 nwhitmont

@nwhitmont Okay, thanks

megancooper avatar Jun 22 '17 21:06 megancooper

@nwhitmont Sorry for all the questions but I'm still having this one issue. I can't mention my bot in the General chat for my team. It's added to the team, but for some reason isn't being recognized. I'd like for members to start a 1:1 with it but I'm not seeing it pop up.

Here is my final manifest.json:

{
  "$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
  "manifestVersion": "1.0",
  "version": "1.0.0",
  "id": "MICROSOFT_ID_REDACTED",
  "packageName": "PKG_REDACTED",
  "developer": {
    "name": "Megan",
    "websiteUrl": "https://website.com/",
    "privacyUrl": "https://website.com/privacy",
    "termsOfUseUrl": "https://website.com/app-tos"
  },
  "name": {
    "short": "Bridget v0.0"
  },
  "description": {
    "short": "A Bot",
    "full": "This app displays information."
  },
  "icons": {
    "outline": "outline.png",
    "color": "color.png"
  },
  "accentColor": "#FFFFFF",
  "bots": [
    {
      "botId": "MICROSOFT_ID_REDACTED",
      "isNotificationOnly": false,
      "needsChannelSelector": "true",
      "scopes": [ "personal", "team" ]
    }
  ]
}

And here is a snapshot of the bot in Teams: 1

But for some reason I still can't mention or chat with the bot? Thanks again and apologies

megancooper avatar Jun 22 '17 21:06 megancooper

@megancooper I'm unable to reproduce the error. When I sideloaded my test bot into MS Teams (desktop app version) I was able to invoke the bot immediately using @BotName in any channel on the team. Are you using MS Teams web or desktop app?

nwhitmont avatar Jun 22 '17 23:06 nwhitmont

@nwhitmont I'm using the desktop app

megancooper avatar Jun 22 '17 23:06 megancooper

I have Microsoft Teams Version 1.0.00.13252 (64-bit) on Win 10.

nwhitmont avatar Jun 22 '17 23:06 nwhitmont

what happens if you delete the bot app & sideload it again?

nwhitmont avatar Jun 22 '17 23:06 nwhitmont

@megancooper You said above that the bot was able to be @mentioned in a team but not callable in 1:1, and then after re-sideloading you're not able to @mention it? Does it resolve the @mention by filling in the bot name? (Note too that the bot name would be the one from the Bot Framework registration.) In other words, is it a response issue, or can it not resolve the @botname? Happy to try myself if you want to PM the bot id.

RichMoeMSFT avatar Jun 23 '17 12:06 RichMoeMSFT

@megancooper How's it going on this one? Are you still having issues?

nwhitmont avatar Jun 26 '17 21:06 nwhitmont

@nwhitmont Sorry for my late response. I have fixed the issue.

megancooper avatar Jun 30 '17 19:06 megancooper

@megancooper Thanks for the update. closing

nwhitmont avatar Jul 11 '17 00:07 nwhitmont

@megancooper @nwhitmont How did you manage to resolve this? Apparently no matter what I do, I can't get Microsoft Teams to sideload my bot. This is what my manifest.json (app ID redacted) looks like:

{
    "$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
    "manifestVersion": "1.0",
    "version": "1.0.0",
    "id": "MY_REDACTED_APP_ID",
    "packageName": "co.nagarjun.www",
    "developer": {
        "name": "Nagarjun Palavalli",
        "websiteUrl": "http://nagarjun.co/",
        "privacyUrl": "http://nagarjun.co/",
        "termsOfUseUrl": "http://nagarjun.co/"
    },
    "name": {
        "short": "ZipBot",
        "full": "ZipBot"
    },
    "description": {
        "short": "My bot description",
        "full": "my bot description"
    },
    "icons": {
        "outline": "icon-outline.png",
        "color": "icon-color.png"
    },
    "accentColor": "#2ca9d6",
    "bots": [
        {
            "botId": "MY_REDACTED_APP_ID",
            "isNotificationOnly": false,
            "scopes": [
                "personal"
            ],
            "commandLists": [
                {
                    "scopes": [
                        "personal"
                    ],
                    "commands": [
                        {
                            "title": "Help",
                            "description": "Learn how to use ZipBot within Microsoft Teams"
                        }
                    ]
                }
            ]
        }
    ],
    "permissions": [
        "identity",
        "messageTeamMembers"
    ],
    "validDomains": [
        "*.ngrok.io",
        "*.herokuapp.com"
    ]
}

I created a zip folder on my Mac by CD'ing into the app package directory and doing zip -r -X "../app_package.zip" *. I believe this makes it so that there is no root folder inside the zip folder (which Microsoft Teams does not allow). Struggling with this issue for hours. Appreciate any help.

nagarjun avatar Nov 18 '17 12:11 nagarjun