无法将Microsoft Team应用程序部署到Azure

问题描述

摘要 尝试将用打字稿编写的Microsoft Teams Node.JS项目部署到Azure服务器时,Teams应用程序将引发错误“无法访问此应用程序”。在浏览器中打开时,该应用程序运行正常,但在Teams中无法识别。似乎所有清单均已正确设置,并且在App Studio的验证中运行时,不会返回错误

尝试的解决方案: 尝试将清单与Microsoft提供的示例进行匹配。尝试使用Microsoft共享的示例将Microsoft Team应用程序部署到Azure。

代码

Teams App Manifest:

{
  "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.schema.json","manifestVersion": "1.7","id": "dfe1fc96-d4db-4ed4-b76a-c26194928313","version": "1.0.0","packageName": "messageleapteams","developer": {
    "name": "Real Data Consulting","websiteUrl": "https://messageleapteams.azurewebsites.net","privacyUrl": "https://messageleapteams.azurewebsites.net/privacy.html","termsOfUseUrl": "https://messageleapteams.azurewebsites.net/tou.html"
  },"name": {
    "short": "messageLeapTeams","full": "messageLeapTeams"
  },"description": {
    "short": "Todo: add short description here","full": "Todo: add full description here"
  },"icons": {
    "outline": "icon-outline.png","color": "icon-color.png"
  },"accentColor": "#D85028","configurableTabs": [
    {
      "configurationUrl": "https://messageleapteams.azurewebsites.net/messageLeapTeamsTab/config.html?name={loginHint}&tenant={tid}&group={groupId}&theme={theme}","canUpdateConfiguration": true,"scopes": [
        "team"
      ]
    }
  ],"staticTabs": [],"bots": [],"connectors": [],"composeExtensions": [],"permissions": [
    "identity","messageTeamMembers"
  ],"validDomains": [
    "messageleapteams.azurewebsites.net"
  ],"showLoadingIndicator": true,"isFullScreen": false,"webApplicationInfo": {
    "id": "dfe1fc96-d4db-4ed4-b76a-c26194928313","resource": "api://messageleapteams.azurewebsites.net/dfe1fc96-d4db-4ed4-b76a-c26194928313"
  }
}

解决方法

我认为,如果可以确保代码没有错误,则可以检查配置。

接下来的描述基于Ms提供的c# sample(会话机器人)。而且我认为nodejs很相似。您可以单击链接并查看详细信息。

  1. 您必须创建带有客户端密码的Azure广告应用,然后修改“ appsetting”文件以确保代码可以在本地运行。
  2. 需要ngrok,以便您可以访问在本地运行的代码。
  3. pls在Azure门户上创建一个机器人,输入正确的appId,客户端密钥(在setp 1中创建)和消息传递终结点(在启动ngrok之后获取https url,并且不要忘记在之后附加'/ api / messages'网址)
  4. 现在您可以通过网络聊天测试在本地环境中运行的代码。
  5. 如果要在Teams客户端中进行测试,则需要修改“ manifest.json”并创建一个ZIP文件,并将您的漫游器上传到Teams。然后,您必须在步骤3中创建的漫游器中,添加团队渠道enter image description here

请注意,如果在步骤1中创建的Azure AD应用程序属于与Teams登录帐户的租户不同的租户,则应将应用设置为多租户应用程序(创建时)一个应用程序,它将要求您选择允许访问此应用程序的人。

如果在本地运行程序没有问题,则在deploying to azure app service之后就可以了。

,

事实证明已正确部署了Web应用程序并正确构建了清单,但是对于在Azure中托管的“团队”选项卡应用程序,必须禁用加载指示器。 我通过在manifest.json

中设置"showLoadingIndicator": false来解决此问题