0
votes

i done the following steps:

  1. created web app bot (bot framework sdk v4) and perform 'test web chat'. which is successful and the bot responded. note: Microsoft app id and password are created.

  2. Downloaded the code.

  3. updated bot file(.bot) with luis and qna configuration manually

    #{
    "appId": "XXXXXXX",
    "authoringKey": "xxxxxxxxxx",
    "version": "0.1",
    "region": "xxxxx",
    "type": "luis",
    "name": "BasicBotLuisApplication",
    "id": "6"
    #}
    
    #{
    "appId": "XXXXXXX",
    "authoringKey": "xxxxxxxxxx",
    "version": "0.1",
    "region": "xxxxx",
    "type": "qna",
    "name": "myqna"
    #}
    

    and put 'Padlock' with empty value

  4. Also updated the code (Startup.cs,BotServices.cs) and build app locally.

  5. For testing locally,used bot framework emulator and which was successful.
  6. Then 'Publish' the application with visual studio.
  7. Try to connect with 'Test webchat'. The operation failed and received error code(401 and 403).

what shall do? any solutions?

2
Do you have other pages in your bot that work? For example, do you have the default.htm page that comes by default underneath wwwroot folder? (Browse to https://<your bot application>.azurewebsites.net/ to test). Does browsing to the endpoint (https://<your bot application>.azurewebsites.net/api/messages) give you the typical HTTP 405, or does it also give a 401/403? - Dana V

2 Answers

1
votes

401 is unauthorized so did you make sure your file containing your authorization key got published?

If the file is not part of your solution/project it will not get deployed. Make sure that file is available post deployment on your app service (I presume?), you can use Kudu by going to [AppServiceName].scm.azurewebsites.net

Use the Debug Console to verify the file.

0
votes

You need to look at your authentication. Usually, there should be some sort of session ID token that your browser session caches after authentication. From what you told us, there doesn't seem to be an authentication step.