Azure bot from template with credentials doesn't work in emulator

霸气de小男生 提交于 2019-12-25 08:39:09

问题


My bot just refuses to work with my appId & password on my dev emulator so tried to do the simplest version possible. This is what I tried:

  1. Create a new blank project from the newly copied "Bot Application" template.
  2. Update all the NuGet packages (except System.IdentityModel.Tokens.Jwt v5.1.4 as it isn't compatible with Microsoft.Bot.Builder 3.8.1).
  3. Test it in the emulator with no AppId / Password and it works.
  4. Update the AppId & Password in the web.config.
  5. Run the emulator again and enter the AppId & Password into it.

So it's a brand new solution from the template with just with my credentials changed and this is the error that it gives:

POST 401 [conversationUpdate] 
Error: The bot's MSA appId or password is incorrect. 
Edit your bot's MSA info

The credentials are definitely correct as I've tested then with the cUrl command and received the token.

My dev machine is Windows Server 2008 R2.


回答1:


You don't need the App ID and password when you are developing locally. You can also test your bot via the Bot Framework Developer Portal web chat once your bot is deployed & registered.

Scenario 1: If you are running your bot code on your local machine, don't use the app ID or password in the emulator.

Scenario 2: If your bot is deployed to Azure or other cloud service, then you will need to use the app ID/pwd to test in the emulator. On Azure, the recommended method is to add your MICROSOFT_APP_ID and MICROSOFT_APP_PASSWORD to your application settings as described in step 10 of the article Deploying Bot Framework to Azure on Linux.



来源:https://stackoverflow.com/questions/44662119/azure-bot-from-template-with-credentials-doesnt-work-in-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!