node.js - Microsoft Bot Framework error - InternalServerError { "Message": "An error has occurred." } -
when pushed bot code azure successful. tested worked before pushing azure using node app.js
i updated web.config file correct credentials
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! name?'); }, function (session, results) { session.send('hello %s!', results.response); } ]);
when @ azure logs following messages
2016-11-17t13:31:12.880 executing: 'functions.messages' - reason: 'this function programmatically called via 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 scripthost error has occurred 2016-11-17t13:31:12.880 error: implement me. unknown stdin file type! @ process.getstdin [as stdin] (internal/process/stdio.js:82:15) @ consoleconnector.listen (d:\home\site\wwwroot\messages\node_modules\botbuilder\lib\bots\consoleconnector.js:11:60) @ object.<anonymous> (d:\home\site\wwwroot\messages\index.js:3:48) @ module._compile (module.js:556:32) @ object.module._extensions..js (module.js:565:10) @ module.load (module.js:473:32) @ trymoduleload (module.js:432:12) @ function.module._load (module.js:424:3) @ module.require (module.js:483:17) @ 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! @ process.getstdin [as stdin] (internal/process/stdio.js:82:15) @ consoleconnector.listen (d:\home\site\wwwroot\messages\node_modules\botbuilder\lib\bots\consoleconnector.js:11:60) @ object.<anonymous> (d:\home\site\wwwroot\messages\index.js:3:48) @ module._compile (module.js:556:32) @ object.module._extensions..js (module.js:565:10) @ module.load (module.js:473:32) @ trymoduleload (module.js:432:12) @ function.module._load (module.js:424:3) @ module.require (module.js:483:17) @ require (internal/module.js:20:19).
i not know or how occurred.
any appreciated,
thanks
i deploy microsoft bot framework azure app service following steps. please have try?
1.once you’ve registered bot, set necessary environment variables in azure portal.
2.get bot builder
, restify
modules using npm.
npm install --save botbuilder npm install --save restify
3.make file named app.js
, hello in few lines of code.
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 %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.go microsoft bot framework portal , edit bot details. use endpoint generated azure deployment, , don't forget when using bot application template you'll need extend url pasted in path endpoint @ /api/messages
. should prefix url https instead of http. 5.once you’ve gone through steps here, can test , verify bot framework can communicate bot’s web service.
hope helps.
Comments
Post a Comment