Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
474 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

Configure Azure Application Settings


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...