CallingBotSample 不会使用自适应卡抛出欢迎文本

CallingBotSample does not throw welcome Text with Adaptive Card

我正在尝试 运行 这个示例,但运气不佳 :

https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/bot-calling-meeting/csharp/

我在 Azure 上创建了一个应用程序,然后使用 https://dev.botframework.com/bots/new 创建了一个 BOT 并 link 它到这个应用程序并启用了调用并配置了一个 ngrok URL 这样我就可以 运行 本地项目 Visual Studio.

我已按照自述文件中的说明配置了应用程序和示例,并将其旁加载到团队中,将其安装到指定团队的常规频道。

尽管我可以调用 BOT,并且它使用 Visual Studio 项目中的 wav 文件进行应答(通过 ngrok 在本地 运行s),但我没有看到自适应卡在 Teams 中用它来做呼叫控制,如图 instructions/readme at

https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/bot-calling-meeting/csharp/README.md

编辑: 我注意到 CallingBot.OnMembersAddedAsync() 看起来可能负责显示卡片,当我向团队添加新成员时会触发,但随后会抛出错误: System.Exception.Message.get 返回“无法获取客户端凭据的令牌。(AADSTS700016:在目录 'Bot Framework' 中找不到标识符为“<>”的应用程序。

请给我任何建议 - 我错过了什么

21 年 11 月 26 日编辑: 配置如下

in the supplied manifest, we set 
=================================
the id to the           "Teams App ID"
we set the Bot id to the    "Azure Application (client) ID"


in the appsettings.json, we set
================================
  "MicrosoftAppId":         "Azure Application (client) ID"
  "MicrosoftAppPassword":   "Azure Application password"


  "AzureAd": {
    "TenantId":     "Company Tenant ID"
    "ClientId":     "Azure Application (client) ID"
    "ClientSecret":     "Azure Application password"

  "Bot": {
    "AppId":        "Azure Application (client) ID"
    "AppSecret":    "Azure Application password"


  "UserId": "User A id within Teams",

  "Users": [
    {
      "DisplayName":    "Name of User B",
      "Id":         "ID of User B"
    },
    {
      "DisplayName":    "Name of User C",
     "Id":      "ID of User C"
    },
    {
      "DisplayName":    "Name of User D",
     "Id":      "ID of User D"
    },
    {
      "DisplayName":    "Name of User E",
     "Id":      "ID of User E"
    }
  ]


When I add the manifest to a team with the code already running, OnMembersAddedAsync() fires and that leads to AdapterWithErrorHandler() firing with the exception :

"Failed to acquire token for client credentials. 
(AADSTS700016: Application with identifier '"Azure Application (client) ID"' was not found in the directory 'Bot Framework'. 
This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. 
You may have sent your authentication request to the wrong tenant.\r\n
Trace ID: 2eea2365-0e69-434d-befa-eeeb874a5101\r\n
Correlation ID: 0b06ce58-c03f-4a9b-a897-890f910269b7\r\nTimestamp: 2021-11-26 14:08:27Z)"

这里的问题是,虽然我们已经将 BOT 设置为多租户,但我们没有,另外将 App 设置为多租户。 即,通过做:

  • 点击验证
  • 确保支持的帐户类型设置为 “任何组织目录中的帐户(任何 Azure AD 目录 - 多租户)”。
  • 点击保存