我有一个在 Azure 上运行的 Web App Bot。
它使用Microsoft Bot Framework Direct Line API 3.0。
我想使用URL Ping 测试类型而不是多阶段 Web 测试来进行 Bot的可用性测试,因为我没有 Visual Studio 2017 企业版。
在 Bot 的消息控制器中,这就是我处理 Ping 响应的方式。在 localhost 中运行 Bot 时,我能够在 Bot 模拟器中获得预期的响应。
else if (message.Type == ActivityTypes.Ping)
{
ConnectorClient client = new ConnectorClient(new Uri(message.ServiceUrl));
var reply = message.CreateReply();
reply.Text = "{Some message}";
await client.Conversations.ReplyToActivityAsync(reply);
}
但是,当我连接到 Azure 中的 Bot 时,我收到 HTTP 错误 500。
我不确定根本原因是什么,想知道是否是由于 URL Ping 测试不知道 Direct Line 机密。
感谢您在这方面的帮助。
非常感谢。