Azure Bot模拟器错误:POST 401 directline.postActivity [英] Azure Bot Emulator Error : POST 401 directline.postActivity

查看:87
本文介绍了Azure Bot模拟器错误:POST 401 directline.postActivity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft bot生成器(C#LUIS模板)开发一个bot,并设置Bot Emulator在本地调试我的代码,但是当我在bot emulator上发送消息时,它会出现以下错误:

I am developing a bot using Microsoft bot builder (C# LUIS template) and setting up Bot Emulator to debug my code locally but when I send message on bot emulator it gives below error:

POST 401 directline.postActivity

POST 401 directline.postActivity

仿真器JSON检查器提供了更多与身份验证有关的详细信息

Emulator JSON Inspector giving more details which seems related to authentication

"BotAuthenticator无法验证传入请求!"

"BotAuthenticator failed to authenticate incoming request!"

对于在本地运行代码,我不会传递web.config中以下设置的任何值,也不会传递来自模拟器的应用程序ID和密码的任何值.

For running code locally I am not passing any value for below settings in web.config and also not passing any value for app id and password from emulator.

<add key="MicrosoftAppId" value="" />
<add key="MicrosoftAppPassword" value="" />

我检查了所有web.config appsetting与Azure WebApp中的Application Settings相同.还使用InMemory存储进行本地调试,以下是global.asax.cs中的代码

I checked all web.config appsetting are same as Application Settings in azure WebApp. Also using InMemory store for local debugging, below is code from global.asax.cs

var store = new InMemoryDataStore();

端点网址在模拟器中也是正确的

Endpoint url is also correct in emulator

http://localhost:3984/api/messages

我也安装了ngrok,但没有运气.

I also installed ngrok but no luck.

推荐答案

web.config文件中的AppSettings存在问题.因此,如果您看到此错误,请确保已在web.config文件的AppSettings下正确提供了键值

There was issue with AppSettings in web.config file. So if you see this error make sure you have correctly provided key-value under AppSettings in web.config file

这篇关于Azure Bot模拟器错误:POST 401 directline.postActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆