1

在机器人框架门户上使用“测试与您的机器人的连接”时没有授权。

我在这里看到了许多关于同一主题的问题,但仍然无法使其正常工作。我正在尝试确保我的端点授权有效,但我不断收到错误...

我已遵循信中的建议:https ://docs.botframework.com/en-us/support/troubleshooting-bot-framework-authentication/

起初的错误是;

InternalServerError
{
"message": "An error has occurred.",
"exceptionMessage": "Object reference not set to an instance of an object.",
"exceptionType": "System.NullReferenceException",
"stackTrace": " 

(ETC...)

我发现我需要将我的天蓝色计划升级到基本以包含 SSL。但是,当我现在通过机器人框架门户测试我的机器人连接时,我得到了;

InternalServerError
{
  "message": "An error has occurred."
}

该机器人本身在 Skype 和网络聊天上运行良好 - 它只是不想工作的授权部分。

按照托管在 azure 上的 Web 应用程序的链接,证明我有一个 HTTPS 地址。我唯一没有尝试过的是为我的应用购买专用的 SSL 证书。

但是,基本的 Azure 计划肯定包括通用 Microsoft 证书下的 SSL 吗?有什么想法吗?

最后一条信息,机器人的网络聊天频道不断向我显示以下问题;

There was an error sending this message to your bot: HTTP status code
InternalServerError

Azure 托管、Web 应用、b1 基本计划...

4

2 回答 2

1

您是否正确设置了appSettings?

 <!-- update these with your BotId, Microsoft App Id and your Microsoft App Password-->
<add key="BotId" value="YourBotId" />
<add key="MicrosoftAppId" value="YourAppId" />
<add key="MicrosoftAppPassword" value="YourAppPassword" />

您可以通过编辑机器人的详细信息从Bot Framework 站点获取这些信息

此外,您不必为您的应用购买专用 SSL 证书。您只需使用 https url ( https://foobot.azurewebsites.net/api/messages )设置消息传递端点

于 2016-12-07T18:53:46.770 回答
1

好的,我设法通过消除过程解决了这个问题。错误代码如下(来自 MessagesController.cs);

if (activity.Type == ActivityTypes.Message || activity != null)

虽然代码运行愉快,但端点授权在命中时会跳闸;

activity != null

因此,通过恢复到以下端点授权工作;

if (activity.Type == ActivityTypes.Message)

不要问我代码中的null检查是怎么回事,我不知道!或者为什么授权不喜欢空检查..

于 2016-12-28T13:58:19.703 回答