Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to configure the bot in the Microsoft Teams #12200

Closed
tbhaxor opened this issue Aug 9, 2024 · 7 comments
Closed

Unable to configure the bot in the Microsoft Teams #12200

tbhaxor opened this issue Aug 9, 2024 · 7 comments
Assignees
Labels

Comments

@tbhaxor
Copy link

tbhaxor commented Aug 9, 2024

Describe the bug

I am novice in the MS teams and bot development. I have created the project from the basic bot template and added the configure properties as guided here.

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
    "manifestVersion": "1.16",
    "version": "1.0.0",
    "id": "${{TEAMS_APP_ID}}",
    "developer": {
        "name": "Teams App, Inc.",
        "websiteUrl": "https://www.example.com",
        "privacyUrl": "https://www.example.com/privacy",
        "termsOfUseUrl": "https://www.example.com/termofuse"
    },
    "icons": {
        "color": "color.png",
        "outline": "outline.png"
    },
    "name": {
        "short": "MyProject${{APP_NAME_SUFFIX}}",
        "full": "full name for MyProject"
    },
    "description": {
        "short": "short description for MyProject",
        "full": "full description for MyProject"
    },
    "accentColor": "#FFFFFF",
    "bots": [
        {
            "botId": "${{BOT_ID}}",
            "scopes": [
                "team",
                "groupchat"
            ],
            "supportsFiles": false,
            "isNotificationOnly": false,
            "configuration": {
                "groupChat": {
                    "fetchTask": true
                },
                "team": {
                    "fetchTask": true
                }
            },
        }
    ],
    "composeExtensions": [],
    "configurableTabs": [],
    "staticTabs": [],
    "permissions": [
        "identity",
        "messageTeamMembers"
    ],
    "validDomains": []
}

When I try to run the project from the teams toolkit, it fails at teamsApp/validateManifest step

Summary:
1 failed.
You can check and update your Teams manifest at ./appPackage/manifest.json.
(×) Error: /bots/0 must NOT have additional properties

And this is because of configuration key. When I checked the JSON schema, there is no such key available in the object of bots array, but the schema in the documentation mentions otherwise.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project with bot template
  2. Follow documentation https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bot-configuration-experience?tabs=JS1%2Cteams-bot-sdk2%2Cteams-bot-sdk3#update-app-manifest

VS Code Extension Information (please complete the following information):

  • OS: [e.g. iOS] Linux
  • Version [e.g. 22] v5.8.1

CLI Information (please complete the following information):

  • OS: [e.g. iOS8.1] Linux
  • Version [e.g. 22]3.0.2

Additional context
Add any other context about the problem here.

Copy link
Contributor

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Aug 9, 2024
@adashen adashen added investigating TA:E2E Team Area: E2E labels Aug 12, 2024
@anchenyi
Copy link
Contributor

hi @tbhaxor, the doc you mentioned is outdated, and "Bots.configuration" is not supported now. I have reported this issue to the related PM team days ago, and I will get back to you ASAP. Sorry for the inconvenience.

@tbhaxor
Copy link
Author

tbhaxor commented Aug 12, 2024

Hi @anchenyi is there any other way to configure bots the same way shown in the documentation? Thing is I am building a bot that requires saving API key and some message preferences. Currently I am using commands (haven't published, tried locally with on my personal team) but that requires sending message to the channel which leaks the API key for all the users.

@anchenyi
Copy link
Contributor

hi @tbhaxor, you can try using the Adaptive Card. It allows you to configure the response template of user submissions, so that you can hide all sentitive data. You can refer to this sample project(link) and select the Adaptive Card you need.

Let me use one Adaptive Card from this project as an example to help you understand quickly.

  • src/commands/reportIncidentCommandHandler.ts is a registered command to handle user message: "report incident".
  • src/adpativeCards/reportIncidentResponse.json is the report template.
  • src/adaptiveCards/incidentReportedResponse.json is the response template of user submissions, you can edit this file to hide sensitive data.

@tbhaxor
Copy link
Author

tbhaxor commented Aug 14, 2024

Is there anyway I could send the message to a particular user in the group/channel? Like in slack

@anchenyi
Copy link
Contributor

hi @tbhaxor, for better future reference, could you open a separate GitHub issue to discuss how a group bot can send a message to a specific user? This issue will be used to continue tracking the updates to the bots.configuration section in the manifest. Thank you!

@MuyangAmigo MuyangAmigo removed the needs attention This issue needs the attention of a contributor. label Aug 15, 2024
@tbhaxor
Copy link
Author

tbhaxor commented Aug 21, 2024

Adaptive cards approach works for me.

@tbhaxor tbhaxor closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants