Microsoft Bot框架错误 – InternalServerError {“消息”:“发生错误。”}

当我把bot代码推到azure色的时候,它是成功的。 在使用节点app.js将其推到azure色之前,我testing了它的工作

我用正确的凭据更新了我的web.config文件

var builder = require('botbuilder'); var connector = new builder.ConsoleConnector().listen(); var bot = new builder.UniversalBot(connector); bot.dialog('/', [ function (session) { builder.Prompts.text(session, 'Hi! What is your name?'); }, function (session, results) { session.send('Hello %s!', results.response); } ]); 

当我看着azure色的日志,我收到以下消息

 2016-11-17T13:31:12.880 Executing: 'Functions.messages' - Reason: 'This function was programmatically called via the host APIs.' 2016-11-17T13:31:12.880 Function started (Id=22f4fffb-ad0d-4b54-b86f-dd895c098910) 2016-11-17T13:31:12.880 Function completed (Failure, Id=22f4fffb-ad0d-4b54-b86f-dd895c098910) 2016-11-17T13:31:12.880 A ScriptHost error has occurred 2016-11-17T13:31:12.880 Error: Implement me. Unknown stdin file type! at process.getStdin [as stdin] (internal/process/stdio.js:82:15) at ConsoleConnector.listen (D:\home\site\wwwroot\messages\node_modules\botbuilder\lib\bots\ConsoleConnector.js:11:60) at Object.<anonymous> (D:\home\site\wwwroot\messages\index.js:3:48) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) 2016-11-17T13:31:12.880 Function started (Id=22f4fffb-ad0d-4b54-b86f-dd895c098910) 2016-11-17T13:31:12.880 Function completed (Failure, Id=22f4fffb-ad0d-4b54-b86f-dd895c098910) 2016-11-17T13:31:12.895 Exception while executing function: Functions.messages. mscorlib: Error: Implement me. Unknown stdin file type! at process.getStdin [as stdin] (internal/process/stdio.js:82:15) at ConsoleConnector.listen (D:\home\site\wwwroot\messages\node_modules\botbuilder\lib\bots\ConsoleConnector.js:11:60) at Object.<anonymous> (D:\home\site\wwwroot\messages\index.js:3:48) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19). 

我不知道这是怎么发生的。

任何帮助,将不胜感激,

谢谢

我通过以下步骤成功地将Microsoft Bot Framework部署到Azure应用程序服务。 你可以试试吗?

1.一旦注册了bot,在Azure门户中设置必要的环境variables。

在这里输入图像说明

2.使用npm获取Bot BuilderRestify模块。

 npm install --save botbuilder npm install --save restify 

创build一个名为app.js的文件,用几行代码打个招呼。

 var restify = require('restify'); var builder = require('botbuilder'); // Setup Restify Server var server = restify.createServer(); server.listen(process.env.port || process.env.PORT || 3978, function () { console.log('%s listening to %s', server.name, server.url); }); // Create chat bot var connector = new builder.ChatConnector({ appId: process.env.MICROSOFT_APP_ID, appPassword: process.env.MICROSOFT_APP_PASSWORD }); var bot = new builder.UniversalBot(connector); server.post('/api/messages', connector.listen()); bot.dialog('/', function (session) { session.send("Hello World"); }); 

4.转到Microsoft Bot Framework门户并编辑您的机器人详细信息。 使用从Azure部署中生成的端点,不要忘记,在使用Bot应用程序模板时,您需要将path所粘贴的URL扩展到/api/messages端点。 您还应该使用HTTPS而不是HTTP前缀您的URL。 在这里输入图像说明 5.一旦您完成了这里的步骤,您可以testing并validationBot框架可以与您的Bot的Web服务进行通信。

在这里输入图像说明

希望这可以帮助。